Click to See Complete Forum and Search --> : HTML to EXCEL on the fly.


cakeday
12-02-2003, 05:12 PM
Hi all,

I have a webpage, which displays the records queried from the oracle database on the web using HTML table(s).

I want to give the users a button,which upon clicked should exports whatever is on the webpage to an excel spreadsheet.

I cannot hardcode and have a .xls file sitting on the server, because in my webpage the parameters are passed dynamically, so i need to create the excel file on the fly.

I want to accomplish this using javascript, because the web page technology i am using(PSP - PL/SQL server pages supports javascript)

So can anyone tell me, how to do this. Any sample codes or links will be very useful. Thank you in advance.

FYI, I am newbie when it comes to javascript.

Gollum
12-03-2003, 02:36 AM
I'm afraid that even if you could generate an xls file in javascript, you wouln't be able to save it due to javascript's security restrictions.
The usual way around this issue is to offer a link that generates a .csv (comma separated value) file on the server and downloads it. Excel can then read that file.