ASP to XLS with input text included.
Posted on 2007-10-17
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.