![]() |
| Create Excel File from Access Database |
|
joelhe
|
I have created an ASP application which collects data and stores it in an Access database on the server and generates reports that are viewable on a web site. My customer would like to have the same data in Excel format. Is it possible to automatically create Excel files from data on the server so that they could click on a link or a button and get a file to download. If so, where can I go to learn how to do this?
Thanks in advance - Joel |
||||||||||||
|
|
|||||||||||||
|
Josh
Forum Regular
|
in order to accomplish this you'll need to use a component. .NET may be able to handle this, but without us having excel installed on any of the servers im almost positive that that won't work.
Now... on theother hand... if you just have it outputted as a CSV file then have him download that I know that excel by default opens CSV files. That seems to be your best option to me. |
||||||||||||
|
|
|||||||||||||
|
NickJushchyshyn
|
A workaround would be to create an ASP page that generates an HTML table from the database. Cell/Font formatting is OK, but no content other than the table.
At the beginning of the ASP file (before the table code) add: <% response.ContentType ="application/x-excel" %> If the user has IE and Excel installed, the browser will show the table as an Excel file. The user could then use File->Save... to save the file as an XLS and they're all set. I've done this for a few client sites and it works out great. If you want to force the Excel file to open in a new window, just be sure to set the target="_blank" tag in the link that leads to the Excel output. Other variations of the ContentType property allow for output of Word documents, PDF's etc. Hope this helps. Have fun. |
||||||||||||
|
|
|||||||||||||
|
joelhe
|
Just what I needed. Worked beautifully. Thanks - Joel |
||||||||||||||
|
|
|||||||||||||||
| Create Excel File from Access Database |
|
||
|


