Export transformed XML to Excel

G

Guest

I have a a report that I want to be opened by Excel. It is a simple HTML table

I have set Response.ContentType = "application/ms-excel". I have produced the HTML table by transforming SQL Server XML to HTML by using an asp:xml object and an XSL transform

The page opens in Excel but does not display the data. When i save and imspect source for this page all seams fine there is a simple html table preceeded by "<?xml version="1.0" encoding="utf-8"?>". When i remove this tag mannualy then save and reopen the file with excel it opens correctly

I have tried this office 2000 with no problems at all. I cannot remove the xml tag as if i leave it out of the xsl the the asp:xml object rightly puts it back

Can anyone tell me what the problem with this tag is

Many Thanks
Nick
 
S

Steve C. Orr [MVP, MCSD]

Read this article:
http://www.aspnetpro.com/NewsletterArticle/2003/09/asp200309so_l/asp200309so_l.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net



NAllen said:
I have a a report that I want to be opened by Excel. It is a simple HTML table.

I have set Response.ContentType = "application/ms-excel". I have produced
the HTML table by transforming SQL Server XML to HTML by using an asp:xml
object and an XSL transform.
The page opens in Excel but does not display the data. When i save and
imspect source for this page all seams fine there is a simple html table
preceeded by said:
I have tried this office 2000 with no problems at all. I cannot remove
the xml tag as if i leave it out of the xsl the the asp:xml object rightly
puts it back.
 
G

Guest

Thanks for the quick reply Steve

I had already read your article; in fact it was the last one I read before posting this question

As far as I can see I am producing a HTML table just like in your example. The only difference is that I am using an XSL transform and an asp:xml object to create it. This leaves in the HTML an "<?xml version="1.0" encoding="utf-8"?>" tag just preceding the transformed output

It seams to be this tag that prevents Excel 2002 from rendering the table. If I download and remove this tag and then open with Excel 2002 it renders fine. It also renders correctly when opened with Excel 2000
 

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

Similar Threads

Image shifts to the right when export the page to pdf 4
export to excel 1
Export To Excel 1
Export to excel 4
Export Grid View to Excel 1
export to excel 0
Export Datagrid to Excel 2
export to excel issue 2

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top