0

I'm working with an old classic ASP page that generates an HTML table through SQL. Currently, after the table is generated, the user clicks on a button that redirects the user to another page and re-runs the SQL to generate a new table, but this new page's content type set to Excel format.

I would like to eliminate this overhead and instead pass an HTML table to the next page based on the table's ID.

I know that I can find the object through JavaScript's document.getElementById('IdHere'); but how can I pass that variable through to the next page?

The following is the current form structure:

<form method="post" name="xlsexport" target="_blank" 
    action="payment_analysis_xls.asp?<%=Request.QueryString%>&filename=paymentAnalysis.xls">
    <a href="javascript:void(0);" onclick="javascript:document.xlsexport.submit();">Export to Excel</a>&nbsp;
    <input type="image" src="xls.gif"/>
    <input type="hidden" name="report" value="analysis"/></form>

I assume I'll have to change the form's onClick event to a function that I create, that will grab the table by ID. But how can I proceed from there?

Thank you!

  • 1
    if the data doesn't get modified between the two pages, just stuff it into a server-side session so you don't have to round-trip it through the client. – Marc B Mar 13 '13 at 17:18
  • It does not get modified between the pages. Forgive my ignorance of classic ASP, can I find the table using server side ASP if the table doesn't have `runat="server"` like ASP.NET would? –  Mar 13 '13 at 17:23
  • Which type of overhead are you trying to eliminate: 1. Load on your SQL server? 2. Load on your ASP web server? 3. Time for your user loading the report? – goofballLogic Mar 13 '13 at 17:37
  • I'm trying to reduce the load on the web server and sql server, as it will only make this (semi) intensive query once, rather than twice as it's doing now. –  Mar 13 '13 at 17:47
  • Couldn't you just send your entire table as a hidden form field? – John Mar 13 '13 at 20:35

0 Answers0