Convert DB Recordset into an Excel file

Results 1 to 2 of 2

Thread: Convert DB Recordset into an Excel file

  1. #1
    Join Date
    Dec 1969

    Default Convert DB Recordset into an Excel file

    Is it possible to convert DB getrows result to an excel file that can easily be downloadable? I used an Access db.

  2. #2
    Join Date
    Dec 1969

    Default RE: Convert DB Recordset into an Excel file

    This is an easy thing to do but it took me some time to find it myself.<BR><BR>First, create a new webform.<BR>in the page_load() of the webform do the following process<BR>1. Get your dataset from your DB<BR>2. Use the following code<BR> &#039; Open the excel application and prepare the file.<BR> Response.Buffer = True<BR> Response.ContentType = "application/"<BR> Response.AddHeader("content-disposition", "inline; filename=dynamic.xls")<BR><BR>3. Using Response.write("") statements create a HTML table holding the data from the dataset.<BR><BR>When the page loads the user is asked to open or download the Excel file. If they choose open, the browser the browser opens excel in the browser window and shows the table that you created inside an excel worksheet. If they choose download then they are asked to save the file someplace on their computer(they can change the name if the file if they wish). <BR><BR>Hope this helps,<BR>Kaytrim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts