471,347 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,347 software developers and data experts.

XLT to XLS

I have a web application in .Net 2.0. It generates. I have a web for
where user enters data and I need to generate an excel sheet from that
and send that as an emil to certain email addresses. I have no clue how
to create a new excelsheet from a template. If someone has a code
sample that would be great.

Thanks.

Feb 14 '06 #1
6 2324
> I have a web application in .Net 2.0. It generates. I have a web for
where user enters data and I need to generate an excel sheet from that
and send that as an emil to certain email addresses. I have no clue how
to create a new excelsheet from a template. If someone has a code
sample that would be great.

Thanks.


I don't think you can do it directly, as xslt delivers only text output
(and the xls format is binary).
A trick I sometimes use to generate an 'excel'-upload:
generate the output as a simple html file containing a single table
(which *can* be generated with xslt), give the filename an .xls
extension and use the correct mimetype.

Hans Kesting
Feb 15 '06 #2
This is a trick I have also used - however note that recent version of Excel
also support spreadies in xml format; if your recipients can accept this
(i.e. you know the version at the client), then:

* Create a spreadsheet in Excel that looks like what you want
* Save As / XML Spreadsheet
* Look at the xml and see what it did
* Use xsl to reproduce it based on your data

Hope this helps,

Marc
Feb 15 '06 #3
I don't think you can do it directly, as xslt delivers only text output
(and the xls format is binary).


You can do it more or less directly by using XSL FO, but it does require
software to do the final rendering. I do know that the Apose Total .Net
components (http://www.aspose.com/Products/Aspose.Total/) can be used for
this final step.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:mn***********************@spamgourmet.com...
I have a web application in .Net 2.0. It generates. I have a web for
where user enters data and I need to generate an excel sheet from that
and send that as an emil to certain email addresses. I have no clue how
to create a new excelsheet from a template. If someone has a code
sample that would be great.

Thanks.


I don't think you can do it directly, as xslt delivers only text output
(and the xls format is binary).
A trick I sometimes use to generate an 'excel'-upload:
generate the output as a simple html file containing a single table (which
*can* be generated with xslt), give the filename an .xls extension and use
the correct mimetype.

Hans Kesting

Feb 15 '06 #4
Well I guess I should have made it more clear. I have the XLT. An Excel
template I need to fill data in the xslt and svae that as XSL.(Excel
workbook) and email it as an attachement. The XML is not an option
since it has embeded images in it also. I need to figure out what
object can I use to from the Office 11 Object model to:

1. generate the excel sheet
2. Then apply the template to that.

or

1. Create a nex excelsheet with the already generated XLT

Sorry for the confusion. I am new to the MS Office application
development.

Thanks.

Feb 15 '06 #5
Ah, sorry, somewhere up the line [we] misinterpreted this as a typo for xslt

Our collective bad

Marc
Feb 15 '06 #6
That'a a little out of my league.

Try microsoft.public.vsnet.vstools.office. Should be lots of help there.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"jamesbond" <na*********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Well I guess I should have made it more clear. I have the XLT. An Excel
template I need to fill data in the xslt and svae that as XSL.(Excel
workbook) and email it as an attachement. The XML is not an option
since it has embeded images in it also. I need to figure out what
object can I use to from the Office 11 Object model to:

1. generate the excel sheet
2. Then apply the template to that.

or

1. Create a nex excelsheet with the already generated XLT

Sorry for the confusion. I am new to the MS Office application
development.

Thanks.

Feb 15 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by
reply views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.