Programmatically creating Excel spreadsheets in ASP.NET

  • Thread starter Thread starter Raoul Snyman
  • Start date Start date
R

Raoul Snyman

Hi,

I need to be able to programatically create excel spreadsheets in
ASP.NET (C#), WITHOUT having MS Office on the server.

Does anybody have any advice/links/whatever for me?

Thanks in advance,

Raoul.
 
I belive the ContentType header will only help when you already have an
Excel file to send.

If you do not want to install MS Office then you have to look for third
party solution which will write an excel file from scratch.
It will be much cheaper to buy one than to write it yourself.

George.
 
build a table in html, set the content type to excel (lookup the exact
phrase) and your page should generate as a spreadsheet, and the client will
execute their spreadsheet app or be prompted for download.

That's what I believe will work

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
 
Raoul said:
Hi,

I need to be able to programatically create excel spreadsheets in
ASP.NET (C#), WITHOUT having MS Office on the server.

Does anybody have any advice/links/whatever for me?

Thanks in advance,

Raoul.

Hi Raoul

We ran into the same situation with our senior class project. We
cheated and used some vb script to solve the problem.

If you are going to have excel on the client machine and it is a local
intranet (for security settings) you can display the data as a datagrid.
And then use some vbscript to convert the datagrid to an excel spread
sheet. The only problem we ran across was having to set the security
settings on IE to prompt for initialize and script active X security
setting.

Otherwise one of my team member was suggesting the same thing as Curt.

Bob
 
Was possible since at least Excel 97 (much slower though to convert a big
file). With later version you could also probably use the XML schema used to
save Excel files though doing this yourself may still be overkill compared
with buying a component.

Patrice
 
you can create a simple comma separated list of data in the asp.net
application and save this to a file with the extension ".csv" then
send the file to the requesting client.

If they have excel installed on their machine, the .csv file will be
opened with Excel by default....
 
The only problem we had with this approach: You can not specify datatypes.
So some columns that supposed to be dates were converted to long numbers and
some part numbers (with dash) were converted to the dates.

George.
 
Back
Top