I've done searches in general, searches through the forum, and searches in the FAQs and I'm not quite getting the answer I'm looking for. I have most of it, but not quite all of it, so hopefully someone can help me with the last little bit.
My page is querying a database and then displaying the contents in an HTML table. In the old version of the site (written in ColdFusion), there's a button to click to save the contents of the table into an Excel sheet. The actual CF code is just a line before and after the lines of code that display the table.
I'm trying to replicate this in ASP, but the problems I'm running into seem to indicate that I would have to re-run the query to produce the Excel sheet. This is a bit of a problem because the queries *are* rather big and take time to run. I'd rather not do that. It would also require me to duplicate the code into a seperate page (unless there's a way around this?)
What I'd like is something similar to the CF page, where I can put in a chunk of code that says something like "any content from here on is exported into Excel when the 'export to Excel' button is pressed".
Can such a thing be done? I'm using the following pages to glean my code from so far:
My page is querying a database and then displaying the contents in an HTML table. In the old version of the site (written in ColdFusion), there's a button to click to save the contents of the table into an Excel sheet. The actual CF code is just a line before and after the lines of code that display the table.
I'm trying to replicate this in ASP, but the problems I'm running into seem to indicate that I would have to re-run the query to produce the Excel sheet. This is a bit of a problem because the queries *are* rather big and take time to run. I'd rather not do that. It would also require me to duplicate the code into a seperate page (unless there's a way around this?)
What I'd like is something similar to the CF page, where I can put in a chunk of code that says something like "any content from here on is exported into Excel when the 'export to Excel' button is pressed".
Can such a thing be done? I'm using the following pages to glean my code from so far: