Link to home
Start Free TrialLog in
Avatar of Rootwitch
Rootwitch

asked on

ASP to XLS with input text included.

I've got an ASP page I created in Dreamweaver CS3 that pulls data from an SQLAnywhere database - The page has one table row of data such as account#, patient, status code, balance, etc.based on an SQL query.  

I put Dreamweavers "Repeat Region" behavior on that table to return all the matching accounts. So, once opened in the browser I may have 20 rows of data. In addition to the queried data, I've got 4 empty columns labeled New Bal, New Stat, Notes, etc.

I've already figured out how to create a "download" link that (when clicked) prompts the users to save the ASP page as an Excel doc called "save.xls" using the R e s p o n s e. C o n t e n t T y p e = tag on the linked page. So, the user can open the page, download it as an Excel doc, open the Excel doc and update those 4 extra columns. Cool.

But, I'd like to take this a step further, and on the ASP page put input boxes in the last 4 "update" fields, so the user can type in the new balance, status, etc. for all the accounts listed within the browser, click the download link, and save the Excel document with not only the queried info, but likewise the updated info they typed in for each account while in the web browser.

I've added the input fields, and figured out how to pass the data to my linked (Excel) page. However, likely due to the Repeat Region behavior I'm using, all the user updated field data ends up in each row of my Excel doc.

Meaning....If (from the browser) the user adds a new bal of 500 in row one, and 300 in row two, and 600 in row three, clicks the "download" link, saves the Excel doc, when I open the Excel doc, row ones balance field will have 500,300,600, as will rows two and three.

Please advise.
Avatar of ebertk
ebertk

One problem with this approach might be that whenever you save a page to a file, it retrieves the page either from the server or the Browser's cache.  Anything entered on the page would be lost.  You could go about it by allowing someone to enter their new numbers, hit a button to update the changes to the page (this would need to launch an asp page to handle the update) then they could use your existing link to save the page as an XLS file.
Avatar of Rootwitch

ASKER

>>You could go about it by allowing someone to enter their new numbers, hit a button to update the changes to the page (this would need to launch an asp page to handle the update) then they could use your existing link to save the page as an XLS file.

I just tried that - Same problem - If (from the browser) the user adds a new bal of 500 in row one, and 300 in row two, and 600 in row three, and clicks the "Next" but, which takes them to an ASP handler page, which now has the input data, before downloading it, row ones balance field will have 500,300,600, as will rows two and three.
ASKER CERTIFIED SOLUTION
Avatar of ebertk
ebertk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial