473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Export transformed XML to Excel

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
Nov 18 '05 #1
2 1137
Read this article:
http://www.aspnetpro.com/NewsletterA...200309so_l.asp

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

"NAllen" <an*******@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com...
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.

Nov 18 '05 #2
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

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Saur | last post by:
Hi, I am using an export to excel functionality from my ASP page. I have set the content type as Response.ContentType = "application/vnd.ms-excel" The data i am exporting has values like 1-2,...
0
by: Jason | last post by:
Can anyone point me to some sample code or tutorial that shows how I can export data from a database to an Excel spreadsheet that is already created on the server? I have an Excel spreadsheet...
6
by: Robin Cushman | last post by:
Hi all, I need some help -- I'm working with an A2K database, using DAO, and am trying to read records into a Crystal Report and then export it to a folder on our network as an Excel...
8
by: DC Gringo | last post by:
I have a simple button that should open another window and export a datagrid to an Excel file. I'm getting: "Name 'window' is not declared." What do I need to declare or import? <INPUT...
0
by: kieran | last post by:
Hi, I have an 'export to excel' button on my Datagrid. All works well except that on my Datagrid, I have sub total rows. The subtotal rows use colspan so that the subtotals are given above...
0
by: Sridhar | last post by:
Hi, I have a export to excel function where it exports the data of a datagrid into the excel sheet. For this, I am using the button and the text on that button reads "Export to Excel". Instead...
13
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"...
1
by: JawzX01 | last post by:
Hello All, First, thank you for any help you can provide. I'm trying to do a simple export to excel. I've used the classic code that is all over the internet, and of course it worked without a...
0
by: mustaqueahmad | last post by:
Hi All, I am getting export to excel problem when I am giving IPAddress in URL, but it is working correct when am giving localhost and page name. eg : when I am writing My machine IP...
4
by: Tennotrumps | last post by:
I am trying to export a report to excel but the "excel" option is greyed out. I can export the query the report is based on, but not the report. However, if I open the database on another PC I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.