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-comffice:spreadsheet"
xmlns="urn:schemas-microsoft-comfficeffice"
xmlns:x="urn:schemas-microsoft-comffice:excel"
xmlns:ss="urn:schemas-microsoft-comffice:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-comfficeffice">
<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
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-comffice:spreadsheet"
xmlns="urn:schemas-microsoft-comfficeffice"
xmlns:x="urn:schemas-microsoft-comffice:excel"
xmlns:ss="urn:schemas-microsoft-comffice:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-comfficeffice">
<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