473,320 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to export data from webpage to excel sheet using javascript

Hi,
Somebody pls tell me how to export data from webpage to excel sheet using java script.
rishika
Jan 4 '07 #1
5 32860
r035198x
13,262 8TB
Hi,
Somebody pls tell me how to export data from webpage to excel sheet using java script.
rishika
Moved this to the javascript forum
Jan 4 '07 #2
Hi, I have the same problem, If you have the solution can you send it to me.

regards
Jul 31 '07 #3
gits
5,390 Expert Mod 4TB
hi ...

you cannot do this with standard-javascript (may be there is an ActiveX-Obj for IE only) ... but you may transfer the data to the server and create an excel-sheet there and then deliver it back to the client.

kind regards
Jul 31 '07 #4
Expand|Select|Wrap|Line Numbers
  1. <script language=javascript>
  2. function exportToExcel()
  3. {
  4. var oExcel = new ActiveXObject("Excel.Application");
  5. var oBook = oExcel.Workbooks.Add;
  6. var oSheet = oBook.Worksheets(1);
  7. for (var y=0;y<detailsTable.rows.length;y++)
  8. // detailsTable is the table where the content to be exported is
  9. {
  10.     for (var x=0;x<detailsTable.rows(y).cells.length;x++)
  11.     {
  12.         oSheet.Cells(y+1,x+1) =
  13. detailsTable.rows(y).cells(x).innerText;
  14.     }
  15. }
  16. oExcel.Visible = true;
  17. oExcel.UserControl = true;
  18. }
  19. </script>
  20.  
  21. <button onclick="exportToExcel();">Export to Excel File</button>
Jan 21 '08 #5
acoder
16,027 Expert Mod 8TB
Hi Tushisim, welcome to TSDN!

Thanks for posting. Your solution should work, but, as stated earlier, it would only work in IE.
Jan 21 '08 #6

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

Similar topics

5
by: bimalkumar | last post by:
hi 2 all, i m using some txt boxes and few combo box in my form. how do i export the txt box and combobox data to excel sheet directly without using any database.just get the data from txt...
1
by: bbawa1 | last post by:
have a GridView with data. I want to export this data to an excel sheet. How can I do that. Thanks in advance
3
by: dileepkms | last post by:
can we disable copy and paste functionality for excel sheet using javascript? if we do it, can you send me the code
3
by: priyanka1915 | last post by:
I need to read data from Excel sheet using java classes, and insert the Data in to the tables of a database its really urgent
2
by: sanjuindia2005 | last post by:
How can i read the excel sheet using javascript ?
5
by: sangeethass | last post by:
How to export sql server-2005 table data into excel sheet .. Can u tell me how can i do this both my manually and by programmewise using perl please help me... thanks Sangeetha.S
2
by: umeshchitta | last post by:
Hi ALL, I written code to download data in Excel from webpage in PLSQL. i have used owa_util.mime_header to write data in excel.But if data cmng from db table is "32E104" then data in Excel...
16
by: nicolenwn | last post by:
I have a user form which has a number of buttons on it. Each button represents a vegetable (Eg, Cucumber, Carrot, Tomato) The purpose of this is to take orders from customers for the vegetable...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.