I am attempting to transfer an XML file to an Excel File using XSLT. I am using XmlDataDocument and it slows down greatly on large data sets. A workaround was found on MSDN:
http://support.microsoft.com/kb/318580/EN-US/, But I am not sure how to implement it.
Below is what I am currently using:
Code:
<%@ Page Language="c#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<script language="C#" runat="server">
public void Page_Load(Object sender, EventArgs E) {
string reportname = Request.QueryString["Name"];
string xmlpath = "e:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/ROOT/reportdata";
xmlpath += "/";
xmlpath += reportname;
xmlpath += ".xml";
string xslpath = reportname;
xslpath += "/";
xslpath += reportname;
xslpath += ".xsl";
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
DataSet ds = new DataSet();
ds.ReadXml(xmlpath);
XmlDataDocument xdd = new XmlDataDocument(ds);
XslTransform xt = new XslTransform();
xt.Load(Server.MapPath(xslpath));
xt.Transform(xdd, null, Response.OutputStream);
Response.End();
}
</script>
Any help is appreciated!!!