473,770 Members | 4,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Export HTML table to Excel sheet

2 New Member
Hi,

Please help me with code for

to Export HTML table to Excel sheet using javascript without using ActiveX controls...
The problem is i could get solution for my problem via ActiveX control but our client is not agreed on that.

Thnx in advance
Mar 28 '08 #1
6 9694
pronerd
392 Recognized Expert Contributor
JavaScript has no ability to effect applications outside of its interpreter. So if you are running inside a web browser for instance it can not pass data to programs outside of the web browser.

You should not need to do anything though. As long as your HTML is correctly formed Excel can open an HTML file and read the table structure.
Mar 28 '08 #2
gmujjain4902
2 New Member
sorry as my last post was not decriptive.

Problem:

I have a table in html page.I want to export all my data which is there in that table to Excel sheet on click of a link/button.
Now another problem is i can't use ActiveX control and i have to use javascript only...

kindle suggest a suitable code as a solution.

thnx in advance
Mar 28 '08 #3
pronerd
392 Recognized Expert Contributor
I have a table in html page.I want to export all my data which is there in that table to Excel sheet on click of a link/button.
The answer has not changed. JavaScript can not do this. It has no ability to access an application outside the interpreter it runs in.

Excel can already read data from HTML tables, so as long as your HTML is well formed you can just save the file, and open it in Excel.

Some other options would be :

1. Open a pop-up window with the table data in it, and save that page manually. Then open it in Excel.

2. Or you could create a link that will send a request back to the server, and then have the server generate a the data in a CSV or EXCEL file. If the user's computer has Excel installed it should use Excel to open the file. This will require a server side language to handle the request and generate the data though.


Otherwise ActiveX, or VBA are your only options, and they are probably not going to work unless the user lowers their security settings to allow it.
Mar 28 '08 #4
Wittier
1 New Member
Hi everyone,

You do not need to create scripts. You can use OutWit Hub to export HTML table to Excel sheet. It is a Web collection engine fitting in a new Firefox extension. You can download it at Mozilla.org and see some tutorials at www.outwitter.f r.

Cheers
Aug 19 '08 #5
gits
5,390 Recognized Expert Moderator Expert
... but that's just a firefox solution, in case a cross-browser solution is needed then it will not help ... the best solution in such cases is the already mentioned server-turnaround ... create the xls-file there and let the user download it ... that is your best bet in terms of compatibility ...

kind regards
Aug 19 '08 #6
RyanALEX
3 New Member
Besides the javascript ,you can use some c#/VB.net excel component,for example Spire.XLS.
Aug 17 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3435
by: Anthony Cuttitta Jr. | last post by:
I'm working on some procedures where Access queries are exported to Excel, and then later on, those same workbooks are openned, and I need to target a specific original sheet. Sometimes there will be multiple sheets in the same workbook, sometimes only a single tab. The issue is this: Save query "XLTest - qryExport" to file and the worksheet name becomes "XLTest___qryExport" (three underscores). I have a generic procedure which...
3
25057
by: Mads Petersen | last post by:
I'm stuck in this code. Hope you can and will help me. I launch it from excel. I have made the following code work, but not as i whant. I need the ranges to be working with something like xlDown. eg. this only transferes the first record in the area. ..Fields("Uge").Value = ws.Range("A98").Value Sub SelectMaster()
2
3997
by: Siu | last post by:
Hi, I use the following code to export and import a file Excel from resp. into a Web page with the following code: //EXPORT Response.Clear(); Response.Buffer = true; Response.ContentType = "application/vnd.ms-excel"; Response.Charset = ""; this.EnableViewState = false;
1
1458
by: Dianna | last post by:
Hi, I am using Response.ContentType = "application/vnd.ms-excel" to export an asp page to excel. Nice feature, however, it does not seem to like style sheets. Because of this, my excel file doesn't look as nice as my asp page. Is there any way around this without re-writing page? Any help would be great. Dianna
13
13241
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel" HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=ABC.xls") HttpContext.Current.Response.Write(strHTML) HttpContext.Current.Response.End() However when the user tries to save it the Default File Type is Web Page(*.htm; *.html)
3
2984
by: Sachin Salgarkar | last post by:
I have a DataSet that I need to export to Excel. The dataset has multiple tables. I need a way to export the complete dataset to a single Excel Workbook with sheets for each table in the dataset. Is that possible ? I have seen solutions that export a single table to an Excel file. Opening the XML ( DataSet.getXML() ) in Excel is a little complicated for our users. Besides , the XML mappings are on the same sheet.
7
7810
by: Vanessa | last post by:
hi Everyone, I have two questions on exporting data to Excel using ASP (w/o converting formatted excel file into web page and then plug in the dynamic data): 1. Can we export data into different sheets at Excel? 2. Can we do graph at export? Thanks!!
3
9700
by: yovation | last post by:
Hi, I have a 3 table database. 1 parent 1 child 1 child of child I would like to get the data into excel as 1 sheet (similar to a grouped report).
7
28903
Merlin1857
by: Merlin1857 | last post by:
Its great producing data for users to look at in your web pages and generally that is sufficient for their needs but sometimes you may want to supply your user with the data in a form they can actually do something more with. This code shows you how to display data from your database and then how to give that data to the user in the form of a useable Excel spreadsheet which they can then take away and play with themselves. The way I have shown...
2
6414
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the method.... it creates 6 sheets # region Namespaces using System;
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10231
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10005
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6679
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.