-2

I am trying to take data that I request from an access database and put it into and excel file on the client computer.

I usually use ajax to request a summary of the data I need. It is formatted into an html table.

I need that table to be in an excel format for the user to download.

What I have tried already is to use the vb.net code to open excel and silently save the data to a file, however I realized it's the server side that opens excel, not the client side, in my locally testing of the code, excel would open on my machine and create the file.

When running this on the network, I realized excel isn't on the server, I am not sure if I should just install it or try stream the file?

2

You need to Stream it out via HTTP. See : How to export Excel file to browser from your ASP.NET applications?

Your other option is to save the file on webserver (within the web app), then provide the user with a link to it. You could then have a process that deletes the "Dead" files every so often.

3

You should look into using a library that doesn't require Excel to be installed; one such example is EPPlus.

There are others, as mentioned in this SO question: How to programmatically create a “true” Excel file

1

The easiest way to do this without installing excel on the server is to dump the data to a csv(or tab delimited) file format and serve it to the client which can be opened with excel. Installing excel on a server may not be possible due to network policies and licensing issues.

  • +1 to look at csv format. it would be the easiest way to implement – EL Yusubov Sep 7 '12 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.