By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,658 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,658 IT Pros & Developers. It's quick & easy.

Programmatically creating Excel spreadsheets in ASP.NET

P: n/a
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.
Nov 18 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
CT
Hmm, one way is to have a grid control that can export to an Excel sheet,
but otherwise you need a third-party control that does it for you. Here are
some links:
http://www.infragistics.com/products/grids.asp
http://www.devdirect.com/ALL/GRID_PCAT_1855.aspx
--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Raoul Snyman" <ra**********@psitek.com> wrote in message
news:e1**************************@posting.google.c om...
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.

Nov 18 '05 #2

P: n/a
Don
Hi Raoul,

Our Spread for Web Forms is a spreadsheet component that will import
and export Excel files, as well as many other features. Here's the
link for more info if you're interested in downloading a trial:
http://www.fpoint.com/netproducts/spreadweb/spread.html

- Donald
FarPoint
ra**********@psitek.com (Raoul Snyman) wrote in message news:<e1**************************@posting.google. com>...
Hi,

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

Nov 18 '05 #3

P: n/a
have you looked at the content type setting in the page declaration?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Raoul Snyman" <ra**********@psitek.com> wrote in message
news:e1**************************@posting.google.c om...
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.

Nov 18 '05 #4

P: n/a
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.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
have you looked at the content type setting in the page declaration?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Raoul Snyman" <ra**********@psitek.com> wrote in message
news:e1**************************@posting.google.c om...
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.


Nov 18 '05 #5

P: n/a
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
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:OT*************@TK2MSFTNGP10.phx.gbl...
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.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
have you looked at the content type setting in the page declaration?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Raoul Snyman" <ra**********@psitek.com> wrote in message
news:e1**************************@posting.google.c om...
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.



Nov 18 '05 #6

P: n/a
Cool. I did not know that.
Is it working with Excel 2000? Or XP only?

George.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:ep**************@TK2MSFTNGP12.phx.gbl...
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
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:OT*************@TK2MSFTNGP10.phx.gbl...
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.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
have you looked at the content type setting in the page declaration?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Raoul Snyman" <ra**********@psitek.com> wrote in message
news:e1**************************@posting.google.c om...
> 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.



Nov 18 '05 #7

P: n/a
Raoul Snyman wrote:
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

Nov 18 '05 #8

P: n/a
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

"George Ter-Saakov" <no****@hotmail.com> a écrit dans le message de
news:ec**************@TK2MSFTNGP12.phx.gbl...
Cool. I did not know that.
Is it working with Excel 2000? Or XP only?

George.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:ep**************@TK2MSFTNGP12.phx.gbl...
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
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:OT*************@TK2MSFTNGP10.phx.gbl...
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.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> have you looked at the content type setting in the page declaration?
>
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> Site: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "Raoul Snyman" <ra**********@psitek.com> wrote in message
> news:e1**************************@posting.google.c om...
> > 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.
>
>



Nov 18 '05 #9

P: n/a
Oh, and .DOC types (by specifying word) will work as well, for those
interested, or rather it should :}

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:ec**************@TK2MSFTNGP12.phx.gbl...
Cool. I did not know that.
Is it working with Excel 2000? Or XP only?

George.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:ep**************@TK2MSFTNGP12.phx.gbl...
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
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:OT*************@TK2MSFTNGP10.phx.gbl...
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.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> have you looked at the content type setting in the page declaration?
>
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> Site: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "Raoul Snyman" <ra**********@psitek.com> wrote in message
> news:e1**************************@posting.google.c om...
> > 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.
>
>



Nov 18 '05 #10

P: n/a
It's not really Excel Version Specific, it's just a generic "spreadsheet".
Whatever app they have set to open .XLS will be called.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:ec**************@TK2MSFTNGP12.phx.gbl...
Cool. I did not know that.
Is it working with Excel 2000? Or XP only?

George.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:ep**************@TK2MSFTNGP12.phx.gbl...
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
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:OT*************@TK2MSFTNGP10.phx.gbl...
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.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> have you looked at the content type setting in the page declaration?
>
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> Site: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "Raoul Snyman" <ra**********@psitek.com> wrote in message
> news:e1**************************@posting.google.c om...
> > 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.
>
>



Nov 18 '05 #11

P: n/a
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....
Nov 18 '05 #12

P: n/a
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.
"rupert789" <ru*******@hotmail.com> wrote in message
news:78**************************@posting.google.c om...
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....

Nov 18 '05 #13

P: n/a
Could work also with the SYLK format if it still exists ? (back to Multiplan
?)

Patrice

"Curt_C [MVP]" <software_AT_darkfalz.com> a écrit dans le message de
news:e3**************@TK2MSFTNGP12.phx.gbl...
It's not really Excel Version Specific, it's just a generic "spreadsheet".
Whatever app they have set to open .XLS will be called.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:ec**************@TK2MSFTNGP12.phx.gbl...
Cool. I did not know that.
Is it working with Excel 2000? Or XP only?

George.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:ep**************@TK2MSFTNGP12.phx.gbl...
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
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:OT*************@TK2MSFTNGP10.phx.gbl...
> 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.
>
> "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
> news:%2****************@tk2msftngp13.phx.gbl...
> > have you looked at the content type setting in the page declaration? > >
> > --
> > Curt Christianson
> > Owner/Lead Developer, DF-Software
> > Site: http://www.Darkfalz.com
> > Blog: http://blog.Darkfalz.com
> >
> >
> > "Raoul Snyman" <ra**********@psitek.com> wrote in message
> > news:e1**************************@posting.google.c om...
> > > 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.
> >
> >
>
>



Nov 18 '05 #14

P: n/a
dunno. You'd have to get a list of supported content types. I'm sure it's
out there, just dont have it handy in front of me right now.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Patrice" <no****@nowhere.com> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
Could work also with the SYLK format if it still exists ? (back to Multiplan ?)

Patrice

"Curt_C [MVP]" <software_AT_darkfalz.com> a écrit dans le message de
news:e3**************@TK2MSFTNGP12.phx.gbl...
It's not really Excel Version Specific, it's just a generic "spreadsheet".
Whatever app they have set to open .XLS will be called.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:ec**************@TK2MSFTNGP12.phx.gbl...
Cool. I did not know that.
Is it working with Excel 2000? Or XP only?

George.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:ep**************@TK2MSFTNGP12.phx.gbl...
> 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
>
>
> "George Ter-Saakov" <no****@hotmail.com> wrote in message
> news:OT*************@TK2MSFTNGP10.phx.gbl...
> > 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.
> >
> > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
> > news:%2****************@tk2msftngp13.phx.gbl...
> > > have you looked at the content type setting in the page

declaration? > > >
> > > --
> > > Curt Christianson
> > > Owner/Lead Developer, DF-Software
> > > Site: http://www.Darkfalz.com
> > > Blog: http://blog.Darkfalz.com
> > >
> > >
> > > "Raoul Snyman" <ra**********@psitek.com> wrote in message
> > > news:e1**************************@posting.google.c om...
> > > > 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.
> > >
> > >
> >
> >
>
>



Nov 18 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.