Brian, can you please explain how to use this? thanks, Ant
Originally posted by Brian E: [B]Try this: [/B]
posted 17 years ago
Go ahead and create your database connection and the like as you would in a normal JSP. Make sure that it works and returns the HTML you want it to. Then just put that line of code in the page and it will launch excel and grab the values from the database. I used basically the same code in my database call for HTML and Excel. I used this code:
to sort out what format I wanted. Basically, if I appended the URL to read format=excel, it would execute the code. Otherwise, it would return it as HTML. One thing you might want to be careful about is how the Excel Spreadsheet is formatted. The version my company uses (97) does not support CSS, so I had to use and tags and the like. Just play around with it until you've got the look you want. Good luck.