i am exporting excel by transform xml,xslt into xls. Below is my coding :
ds.WriteXml(MyXmlPath);
XPathDocument xmlDoc = new XPathDocument(MyXmlPath);
XslCompiledTransform XSLTransform = new XslCompiledTransform();
XSLTransform.Load(AppBasePath + @"\Master\XSLT\" + strSelectedXSLT.ToString() + ".xslt");
XSLTransform.Transform(MyXmlPath, MyExcelPath);
From the above coding i am write xml into disk for the given path by using dataset. And read from the disk path in order to transform xls file.
****PROBLEM : Instead of writing & Reading the xml content , why should i write the xml content into string and convert **BECAUSE ITS TAKE HEAVY TIME TO WRITE EXCEL. so i tried below coding . But its not working . ******
StringWriter sw = new StringWriter();
ds.WriteXml(sw, XmlWriteMode.IgnoreSchema);
string xmlcontent = sw.ToString();
XslCompiledTransform XSLTransform = new XslCompiledTransform();
XSLTransform.Load(AppBasePath + @"\Master\XSLT\" + strSelectedXSLT.ToString() + ".xslt");
XSLTransform.Transform(xmlcontent, MyExcelPath);
Any suggestions ?