Programmatically creating Excel spreadsheets in ASP.NET

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.
 
G

George Ter-Saakov

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.
 
C

Curt_C [MVP]

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
 
G

George Ter-Saakov

Cool. I did not know that.
Is it working with Excel 2000? Or XP only?

George.
 
B

Bob Cummings

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
 
P

Patrice

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
 
R

rupert789

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....
 
G

George Ter-Saakov

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.
 
P

Patrice

Could work also with the SYLK format if it still exists ? (back to Multiplan
?)

Patrice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top