Export to Excel from ASP.Net ( OWC ?? ) in what version ?

C

Claude Vernier

Hello,

In my .Net 1.1 with C# web application, the user can select data and see it
in a homemade grid. I provide an Export feature to my users to save as an
Excel file.

An internal web service provides me with an ExcelXP spreadsheet in XML format.

I would like to give to my users a way to select among several Excel formats
and default to one that most of the versions of Excel can read.

Right now, I receive the XML string and send it back to the user with
the content type:

Response.ContentType = "application/vnd.ms-excel";

Of course, users that don't have ExcelXP installed, receives XML
and are not happy with this...

I tried the following code to import the XML into an Excel document but I'm
not
sure if this the best object to do this. I'm already using OWC10 in this app
so I'd like to stick with it.

OWC10.SpreadsheetClass oSpread = new OWC10.SpreadsheetClass();
oSpread.XMLData = sXML;
oSpread.Export(...);

sXML is like:

<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:eek:ffice:spreadsheet"
xmlns:eek:="urn:schemas-microsoft-com:eek:ffice:eek:ffice"
xmlns:x="urn:schemas-microsoft-com:eek:ffice:excel"
xmlns:ss="urn:schemas-microsoft-com:eek:ffice:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:eek:ffice:eek:ffice">
<Author>****</Author>
<Created>2006-07-04T12:35:36Z</Created>
....

I did not find any way to specify an Excel format with the Export method of
the OWC and I would prefer not to save a temp file locally.

Is there any routine I could use to get user's Excel version, match
this version or default to old one and send the file to the user without
saving locally ?

Thanks for any help,
Claude
 
A

Alvin Bruney [MVP]

Is there any routine I could use to get user's Excel >version, match
this version or default to old one and send the file to the >user without
saving locally ?

You can always right a sniffer routine to sniff out the installed component
on end-user's system and take the appropriate action. If you google this
newsgroup you will find sniffer code.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
C

Claude Vernier

Thanks Alvin,

Meanwhile I will try to implement such a sniffer in future versions, I sill
need a solution for saving in different versions. The only method I found is
to reference the Excel application but I remember having problems with that
in the past where Excel stays in memory and Excel is not installed on the
server.

Do you know of any safe methods to save a OfficeXP spreadsheet to any
version of Excel and a good way of sending it to users ?

Thanks again,
Claude


Alvin Bruney said:
Is there any routine I could use to get user's Excel >version, match
this version or default to old one and send the file to the >user without
saving locally ?

You can always right a sniffer routine to sniff out the installed component
on end-user's system and take the appropriate action. If you google this
newsgroup you will find sniffer code.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Claude Vernier said:
Hello,

In my .Net 1.1 with C# web application, the user can select data and see
it
in a homemade grid. I provide an Export feature to my users to save as an
Excel file.

An internal web service provides me with an ExcelXP spreadsheet in XML
format.

I would like to give to my users a way to select among several Excel
formats
and default to one that most of the versions of Excel can read.

Right now, I receive the XML string and send it back to the user with
the content type:

Response.ContentType = "application/vnd.ms-excel";

Of course, users that don't have ExcelXP installed, receives XML
and are not happy with this...

I tried the following code to import the XML into an Excel document but
I'm
not
sure if this the best object to do this. I'm already using OWC10 in this
app
so I'd like to stick with it.

OWC10.SpreadsheetClass oSpread = new OWC10.SpreadsheetClass();
oSpread.XMLData = sXML;
oSpread.Export(...);

sXML is like:

<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:eek:ffice:spreadsheet"
xmlns:eek:="urn:schemas-microsoft-com:eek:ffice:eek:ffice"
xmlns:x="urn:schemas-microsoft-com:eek:ffice:excel"
xmlns:ss="urn:schemas-microsoft-com:eek:ffice:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:eek:ffice:eek:ffice">
<Author>****</Author>
<Created>2006-07-04T12:35:36Z</Created>
...

I did not find any way to specify an Excel format with the Export method
of
the OWC and I would prefer not to save a temp file locally.

Is there any routine I could use to get user's Excel version, match
this version or default to old one and send the file to the user without
saving locally ?

Thanks for any help,
Claude
 
A

Alvin Bruney [MVP]

No, I don't but actually I have a fix for the in-memory problem if you are
doing this from .NET.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Claude Vernier said:
Thanks Alvin,

Meanwhile I will try to implement such a sniffer in future versions, I
sill
need a solution for saving in different versions. The only method I found
is
to reference the Excel application but I remember having problems with
that
in the past where Excel stays in memory and Excel is not installed on the
server.

Do you know of any safe methods to save a OfficeXP spreadsheet to any
version of Excel and a good way of sending it to users ?

Thanks again,
Claude


Alvin Bruney said:
Is there any routine I could use to get user's Excel >version, match
this version or default to old one and send the file to the >user
without
saving locally ?

You can always right a sniffer routine to sniff out the installed
component
on end-user's system and take the appropriate action. If you google this
newsgroup you will find sniffer code.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


message
Hello,

In my .Net 1.1 with C# web application, the user can select data and
see
it
in a homemade grid. I provide an Export feature to my users to save as
an
Excel file.

An internal web service provides me with an ExcelXP spreadsheet in XML
format.

I would like to give to my users a way to select among several Excel
formats
and default to one that most of the versions of Excel can read.

Right now, I receive the XML string and send it back to the user with
the content type:

Response.ContentType = "application/vnd.ms-excel";

Of course, users that don't have ExcelXP installed, receives XML
and are not happy with this...

I tried the following code to import the XML into an Excel document but
I'm
not
sure if this the best object to do this. I'm already using OWC10 in
this
app
so I'd like to stick with it.

OWC10.SpreadsheetClass oSpread = new OWC10.SpreadsheetClass();
oSpread.XMLData = sXML;
oSpread.Export(...);

sXML is like:

<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:eek:ffice:spreadsheet"
xmlns:eek:="urn:schemas-microsoft-com:eek:ffice:eek:ffice"
xmlns:x="urn:schemas-microsoft-com:eek:ffice:excel"
xmlns:ss="urn:schemas-microsoft-com:eek:ffice:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:eek:ffice:eek:ffice">
<Author>****</Author>
<Created>2006-07-04T12:35:36Z</Created>
...

I did not find any way to specify an Excel format with the Export
method
of
the OWC and I would prefer not to save a temp file locally.

Is there any routine I could use to get user's Excel version, match
this version or default to old one and send the file to the user
without
saving locally ?

Thanks for any help,
Claude
 
C

Claude Vernier

I will take anything you have... Thanks !!!

Have a good weekend !
Claude


Alvin Bruney said:
No, I don't but actually I have a fix for the in-memory problem if you are
doing this from .NET.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Claude Vernier said:
Thanks Alvin,

Meanwhile I will try to implement such a sniffer in future versions, I
sill
need a solution for saving in different versions. The only method I found
is
to reference the Excel application but I remember having problems with
that
in the past where Excel stays in memory and Excel is not installed on the
server.

Do you know of any safe methods to save a OfficeXP spreadsheet to any
version of Excel and a good way of sending it to users ?

Thanks again,
Claude


Alvin Bruney said:
Is there any routine I could use to get user's Excel >version, match
this version or default to old one and send the file to the >user
without
saving locally ?

You can always right a sniffer routine to sniff out the installed
component
on end-user's system and take the appropriate action. If you google this
newsgroup you will find sniffer code.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


message
Hello,

In my .Net 1.1 with C# web application, the user can select data and
see
it
in a homemade grid. I provide an Export feature to my users to save as
an
Excel file.

An internal web service provides me with an ExcelXP spreadsheet in XML
format.

I would like to give to my users a way to select among several Excel
formats
and default to one that most of the versions of Excel can read.

Right now, I receive the XML string and send it back to the user with
the content type:

Response.ContentType = "application/vnd.ms-excel";

Of course, users that don't have ExcelXP installed, receives XML
and are not happy with this...

I tried the following code to import the XML into an Excel document but
I'm
not
sure if this the best object to do this. I'm already using OWC10 in
this
app
so I'd like to stick with it.

OWC10.SpreadsheetClass oSpread = new OWC10.SpreadsheetClass();
oSpread.XMLData = sXML;
oSpread.Export(...);

sXML is like:

<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:eek:ffice:spreadsheet"
xmlns:eek:="urn:schemas-microsoft-com:eek:ffice:eek:ffice"
xmlns:x="urn:schemas-microsoft-com:eek:ffice:excel"
xmlns:ss="urn:schemas-microsoft-com:eek:ffice:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:eek:ffice:eek:ffice">
<Author>****</Author>
<Created>2006-07-04T12:35:36Z</Created>
...

I did not find any way to specify an Excel format with the Export
method
of
the OWC and I would prefer not to save a temp file locally.

Is there any routine I could use to get user's Excel version, match
this version or default to old one and send the file to the user
without
saving locally ?

Thanks for any help,
Claude
 
A

Alvin Bruney [MVP]

this link about sums it up
http://www.velocityreviews.com/forums/t123703-aspnet-cant-kill-excelexe-with-office-pia.html

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Claude Vernier said:
I will take anything you have... Thanks !!!

Have a good weekend !
Claude


Alvin Bruney said:
No, I don't but actually I have a fix for the in-memory problem if you
are
doing this from .NET.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


message
Thanks Alvin,

Meanwhile I will try to implement such a sniffer in future versions, I
sill
need a solution for saving in different versions. The only method I
found
is
to reference the Excel application but I remember having problems with
that
in the past where Excel stays in memory and Excel is not installed on
the
server.

Do you know of any safe methods to save a OfficeXP spreadsheet to any
version of Excel and a good way of sending it to users ?

Thanks again,
Claude


:

Is there any routine I could use to get user's Excel >version, match
this version or default to old one and send the file to the >user
without
saving locally ?

You can always right a sniffer routine to sniff out the installed
component
on end-user's system and take the appropriate action. If you google
this
newsgroup you will find sniffer code.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


message
Hello,

In my .Net 1.1 with C# web application, the user can select data and
see
it
in a homemade grid. I provide an Export feature to my users to save
as
an
Excel file.

An internal web service provides me with an ExcelXP spreadsheet in
XML
format.

I would like to give to my users a way to select among several Excel
formats
and default to one that most of the versions of Excel can read.

Right now, I receive the XML string and send it back to the user
with
the content type:

Response.ContentType = "application/vnd.ms-excel";

Of course, users that don't have ExcelXP installed, receives XML
and are not happy with this...

I tried the following code to import the XML into an Excel document
but
I'm
not
sure if this the best object to do this. I'm already using OWC10 in
this
app
so I'd like to stick with it.

OWC10.SpreadsheetClass oSpread = new OWC10.SpreadsheetClass();
oSpread.XMLData = sXML;
oSpread.Export(...);

sXML is like:

<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:eek:ffice:spreadsheet"
xmlns:eek:="urn:schemas-microsoft-com:eek:ffice:eek:ffice"
xmlns:x="urn:schemas-microsoft-com:eek:ffice:excel"
xmlns:ss="urn:schemas-microsoft-com:eek:ffice:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:eek:ffice:eek:ffice">
<Author>****</Author>
<Created>2006-07-04T12:35:36Z</Created>
...

I did not find any way to specify an Excel format with the Export
method
of
the OWC and I would prefer not to save a temp file locally.

Is there any routine I could use to get user's Excel version, match
this version or default to old one and send the file to the user
without
saving locally ?

Thanks for any help,
Claude
 
M

mickwen

for excel export funcationality, I recommand you try using
Spire.DataExport. not needing
have MS Excel installed on the machine, It can create Excel
document,Free download.
link: http://www.e-iceblue.com

Claude Vernier 写é“:
 
C

Claude Vernier

Thanks Alvin and mickwen.

For the Excel, I would like to give it a try but I'm wondering what must be
deployed to my web server ?? Only Excel.exe ? Should I run Office setup ??
Actually, we are using OfficeXP, what to do if I want to be able to save to
spreadsheet for Office 2003, I should install Office 2003 or only deploy the
Excel (2003).exe ??
Thanks !!

For Spire.DataExport, it seems like it is the trial version that is free or
did I not understand my reading ?? Alvin, do you know this tool ??

I hope you will read this...

Thanks again, have a great summer.
Claude
 
A

Alvin Bruney [MVP]

Just import that office excel 10 library in your application. that's it.
did I not understand my reading ?? Alvin, do you know this tool ??
No, I haven't used it or heard about it.
--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 

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

Top