Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

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.

share|improve this answer
    
+1 to look at csv format. it would be the easiest way to implement –  Yusubov Sep 7 '12 at 20:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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