XML to Excel files too large - better way?

Using the below code sample I am able to allow my ASP.Net users to download reports to Excel. 

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

One problem I have discovered is that the native XML format results in a large file when compared to a true XLS document. For example, we have one report that results in an 8 mb file when saved to disk. But if you open the file and do a "save-as" and change the file type from XML to XLS the file is compressed to 1 mb. For remote users the delay in downloading an 8 mb file is long.
This problem only gets worse when we started looking at Reporting Services. The reports are generated very quickly but the export to Excel option also saves the file as an XML document. This results in the same problem of a file that is much larger than it needs to be and creates a situation where export reports is a long tedious process.
Does anyone know of a way around this large XML file size problem?
My first reaction is to have the users save as CSV or TXT format. Many managers do not like this solution since it requires constant reformatting. My second idea was to save in a "true" XLS format from the server (either web server or Report Services server) but I think that would mean installing Excel on the server. I could be wrong but I think that is the only way to save a file as XLS.
I'm stumped for a better solution. Saving reports in XML format is great for being able to send it anywhere and for being able to easily load it in .Net code. But the size of the XML files makes it hard to send reports with just 2000 lines to remote users, even those on good connections. I'm not sure there is a better way though.
2/4/2005 4:36:41 PM
asp.net.xml-datasource 7181 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 53

You could try:

1. Code solution: clean-up the XML design - sounds like you have 7 Mb of tag overhead, perhaps your node and attribute names are too long.
2. Component Solution: install Excel on the server. MS does not support this option, and it is in fact very painful. However, there are many 3rd party components out there that will create the XL file for you.
3. Administrative solution: enable response compression in IIS
2/4/2005 10:58:56 PM
Thanks for the ideas.

The code solution may not be possible, especially for Report Services. I could look at the solutions that I have created but I find it hard to see where I've created 7 to 8 times the overhead in the XML file. It's possible.
I agree that the component solution is less that optimal. I don't want to even go down that road if possible.
I have not heard of response compression in IIS. I will research that.
It just seems to me that there are two very popular trends involved. First is the trend to use XML when possible for obvious reasons. Second is the trend that most managers or web site users are obsessed with downloading reports into Excel. This quickly leads to what appears to be a perfect match since XML can translate right into Excel.
I'm surprised no one else has run into this problem. The one report I created myself was only about 2000 rows in Excel. I'm quite sure that others are generated much more than that in their web applications. Assuming that everyone has web users who like to download into Excel I'm wondering how they get around the size issues (or if they just live with it).
2/7/2005 7:03:42 PM
see Using HTTP Compression

You should also look into Excel Web Queries if you don't already know about this feature. Basically, it lets end users download from a webpage directly into Excel without any programming on your end. Excel 2003 even puts a new entry in the context menu of IE, so you can right-click anywhere in a webpage and select "Export to Excel". In our origanisation, custom Excel exports are a thing of the past.
2/7/2005 10:06:32 PM

Similar Artilces:

XML Transform to 1 XML file to another XML File
Hello All  I am a novice programmer. I want to transform 1 xml file to another xml file. I am looking for a example code where user will select source xml file and create another xml file in different file with different fields with some default validation of parsing date and default values.  Can anyone help me or let me know any available source code in C#/ASP.Net?  Ms Disha I am assuming you know xslt, if not, you would have to go look at that.  But if you do, then this document will help you out http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=...

XML datasource from external website XML file
Hi all i need to extract some data into a page on my website, but the xml file is on different web server, not in our bunch, but out in the ether.is it possible to use this file as a datsource directly, or is there some security issue, and i have to grab it and use it locally...??? the file has been put somewhere it can be accessed with a web browseras this file changes on a daily basis, i would also like to automate the daily retrieval, i'm assuming this is something not too simple either. as you would need a service or something to fire up at a specific time each day?! any he...

XML Creating and Parsing Very large XML Files
Hello Everyone For a long while I have used SAX for Pascal with a Delphi 6 project. it is reading and writing very large XML files (over 800MB and larger). The project has been running for years - and I recently had to upgrade to Delphi 2007 - and I discovered that SAX for Pascal has not been ported to D2007. The authors have provided full source - which I have - but now I need to get it installed into D2007. Has anyone moved the Packages over to D2007? If this is not the best way of reading and writing really large XML files anymore - any thoughts as to what is the best met...

Problems writing to an XML file
I'm brand new to using XML (in fact this is my first project), so bear with me, I may need a little hand-holding. I'm trying to create a page which simply adds data to an existing xml file. Ultimately it will add the data from a form, but to keep things simple, I've been simply using pre-defined values. Originally I was able to get the script to write the xml exactly as I needed, however it would simply overwrite the existing file every time it was accessed. This is unacceptable, as it will be used to add data to one file, sort of like a mini database. So after much pain and gnashi...

Microsoft Chart control for .NET Framework about state management and serialization problem, it works OK with one XML file but fails with another XML file
I use Microsoft Chart control for .NET Framework , you can see details at http://blogs.msdn.com/alexgor/archive/2008/10/27/microsoft-chart-control-for-net-framework-released.aspx The Chart1 is load data from a xml and save to ViewStateData, so even if after I click Reload button, the chart1 still display OK! I'm very strange that the chart1 works well after click Reload button if it's loaded from Chart1.Serializer.Load(HttpContext.Current.Server.MapPath("~/Template/1.xml"));but chart1 don't display fter click Reload button if it's loaded from Chart1.Serializer.Loa...

Splitting XML file to different XML files
hi,I have xml file that represent a table , one of the element(column) of the xml represent category..I want to split the xml file to different xml files base on the categories (each xml file will represent different category).The question is , if it posible to split the original xml using one xslt file, or i must create different xslt file for each category?thanks in advance one xslt for each output.You can also do this with XmlDocument and save it to two seaprate paths.HTHRegards,Rob...

How can i add a xml file to an other xml file?
such as i have a xml file : <item1> <item2> <item3>aaa</item3> <item4>bbb</item4> </item2> <item1> an other one is: <item2> <item3>ccc</item3> <item4>ddd</item4> <item2> i wanted is: <item1> <item2> <item3>aaa</item3> <item4>bbb</item4> </item2> <item2> <item3>ccc</item3> <item4>ddd</item4> <item2> <item1> thanks. You ca...

XML in, XML out
Hi All (and a happy holiday to those that will get a break), I am trying to read in an XML file of addresses. I need to remove all the address data from the file where code =~ /^000/ (there are none in the example data below). I need to reproduce that data 'as is', so I need to honour the tag structure, although the order of the tags doesn't need to be honoured. I have been trying to use XML::Simple and I had a go with XML::Smart but I haven't been able to get the results I want. My best effort is below (with XML::Simple). There are a couple of differences ...

Create an XML file from another XML file
I am using VS 2005 with C#.  I would like to create/generate an xml file from another XML with a differnt structure.  Basically, I want to create the actual xml file for my users whenever they raise my web service method. This is the actual structure of my xml i would like to create the following <Education>  <mydata>    <year>1988 - 1995</year>    <reward>High School Diploma</reward>    <school>Miami Secondary</school>  </mydata>  ...</Education> The original ...

After download a xml file, why my xml file has been changed?
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click        Dim fileName As String = Server.MapPath("~/Products.xml")        Response.Clear()         Response.ContentType = "text/xml"        Response.AddHeader("Content-Disposition", "attachment; filename=" & fileName)                Response.WriteFile(fileName)  ...

Load XMl file and read xml file
How do I load and read nodes from the xml file in c#.??? ThankYou Sample code: http://www.kirupa.com/net/reading_xml_directly_pg1.htmJack Yang.NET Developer Here is how you read xml file and loop and display nodesXmlDocument xDoc = new XmlDocument();xDoc.Load(xmlPath); foreach(XmlNode node in xDoc.SelectNodes("//nodeName you want to display")){Response.Write("name: " + node.Attributes["name"].InnerText + " value: " + node.Attributes["value"].InnerText);}...

XMl to XML
Hello,   I retrieved an XML from the dataset which retrieves data from the table in the database. I need to present the data  in a different structure. Is XSLT the way or are there any other options. please let me know. Thanks!! Yes XSLT is a good choice to convert xml file to other forms. You can take a look at XSLT Tutorial.Sincerely,Young Fang...

How to save an XML string to a formatted XML file (the v2.0 way)?
What is the v2.0 way of doing this:XmlDocument doc = new XmlDocument();//previously prepared xml stringdoc.loadXml("<root>...</root>");XmlTextWriter writer = new XmlTextWriter(Server.MapPath("~/MyNewFile.xml"), null);writer.Formatting = Formatting.Indented;doc.Save(writer);XMLDocument.Save(...) does not have an overload that takes in XmlWriterSettings which can do much more detailed formatting than just the indentation. The recommended way for v2.0 is to use the XmlWriter.Create but it has no overload that takes in a string for the file  path and a string for the cont...

Efficient way to fill a very large XML file?
Hi all.I'm just about to embark on a small module that populates an Xml file from an Sql Server database. The Xml file will go some ways to mirror the structure of the database (it will have multiple tables, with relationships defined, etc). While I know that this can usually be done from a DataSet with relative ease, the database, contains over 300,000 records and the entire contents of the database will regularly be dumped into the Xml file in question, so I imagine that this would cause some performance issues, as the DataSet class can be slow.So, from your experience, can any o...

Creating a xml file with just field names and then binding the xml fields to a datasource???
I have an xml file I created called ReportFields.xml which looks like this: <?xml version="1.0" encoding="utf-8" ?> <ReportFields><AccountNumber></AccountNumber <FirstName></FirstName><LastName></LastName> </ReportFields> I then create a blank crystal report and go into the Database Expert and choose ADO.NET DataSets, I browse to the xml file I just created, in this case ReportFields and give it a Class Name of ReportFields.  Now under Database Fields, I have a ReportFields table with the following columns: ...

Web resources about - XML to Excel files too large - better way? - asp.net.xml-datasource

Mali in mourning after at least 21 killed in hotel attack
Mali on Saturday began three days of national mourning and declared a state of emergency after a nine-hour siege by jihadist gunmen at a top ...

Obama tries to put human face on Syrian refugee debate
KUALA LUMPUR, Malaysia (AP) — Brushing off refugee worries at home, President Barack Obama crouched alongside migrant children on Saturday and ...

Melania Trump: My modeling career shouldn't matter in Donald's presidential run
Republican presidential front-runner Donald Trump said his wife, Melania, would be a “beautiful” and “elegant” first lady. In an interview with ...

Black Friday: Sony Xperia Z5 deal: Save £99 on the James Bond phone with BLAFRIZ5
It's not just Mobiles.co.uk and Carphone Warehouse that have gone early with their Black Friday phone deals. Mobile Phones Direct is also getting ...

Navy Aircraft Carrier Makes Awesome Star Wars: The Force Awakens Trailer Spoof!
The force is strong with the crew of the super carrier USS Dwight D. Eisenhower (CVN-69) and Carrier Air Wing Seven, as you can tell by the fantastic ...

Tesla Model S Recalled Over Potential Seat Belt Malfunction
The Tesla Model S is currently being recalled by the company . Apparently it seems that there is an issue with the car’s front seat belt that ...

Facebook CEO Zuckerberg to take two months of paternity leave
By Yasmeen Abutaleb SAN FRANCISCO (Reuters) - Facebook Inc Chief Executive Officer Mark Zuckerberg said on Friday he will take two months of ...

Man Freed After 3 Decades in Prison Vows Never to Return
Montana man granted clemency after 3 decades behind bars leaves prison, vows never to return

Appeals Court Hears Arguments in DC Gun Law Case
Appeals court hears arguments in DC gun case, city attorney argues judge overstepped authority

Rachel Weisz Teaches Jimmy Fallon How to Properly Pronounce Michael Caine
Rachel Weisz is gorgeous in red while making an appearance on The Tonight Show Starring Jimmy Fallon on Thursday (November 19) in New York City. ...

Resources last updated: 11/21/2015 9:55:42 AM