Abhilash B C

Abhilash B C

  • NA
  • 4
  • 2.3k

Excel report is not generating

Jul 18 2012 8:26 AM
Hi Friends,

I am facing issue while generating excel report.
I could not able to find out whether this error is from SQL, web.

There is a large content of data is converting to excel from XML. here i am receving error thread abort being exception.
But in the aspx page showing time out exception.

I tested in trial by duumping production database, here there is no such exception.
But in trial report is generating 4-5 min.

In prod after 2 min the thread abort being exception occurs.

My code is..


XmlDataDocument
xdd = new XmlDataDocument(ds);
objNewNode = xdd.CreateElement(
"DATERANGE");
objNewNode.InnerXml = CreateDateXML(SearchData);
xdd.DataSet.EnforceConstraints =
false;
string strFilePathToSave = ConfigurationManager.AppSettings["REPORT_FilePath"].ToString();
objFrstNode = xdd.DocumentElement.FirstChild;
xdd.DocumentElement.InsertBefore(objNewNode, objFrstNode);

XslTransform xt = new XslTransform();xt.Load(SearchData.strTemplatePath);
if (!Directory.Exists(strFilePathToSave))
Directory.CreateDirectory(strFilePathToSave);


strSavePath = strFilePathToSave;


System.IO.
FileStream fio = new System.IO.FileStream(strSavePath, System.IO.FileMode.CreateNew);

xt.Transform(xdd,
null,fio);
fio.Close();

Please help me to solve in this.....

Answers (2)