Skip to Content
0
Former Member
Dec 16, 2011 at 04:24 PM

Server crash with multiple calls in IIS when export to pdf

85 Views

Hi,

We are experiencing a problem when the application exports to pdf. It's an web aplication that generate and export to pdf a report. It's running on a windows 2003 server 32Bits. The server is with all the services pack of microsoft installed.

We test it with multiple calls and the application lost the thread in the iis. We log every line and the thread abort in the ExportToStream method. The client receives this message: "The underlying connection was closed: An unexpected error occurred on a receive"

We tried saving it to disk directly but it crash again. Whe have installed the version 13.0.2 sp 1 of the engine

The code is:

using (ReportDocument reportDocument = new ReportDocument())

{

reportDocument.Load(Server.MapPath(reportPath));

reportDocument.SetDataSource(dataSet);

string fileName = Guid.NewGuid() + ".pdf";

string filePath = Server.MapPath(".") + @"\Temp";

Stream stream = null;

try

{

stream = reportDocument.ExportToStream(ExportFormatType.PortableDocFormat);

PDFDocument pdfDocument = PdfHelper.AddAutoPrint(stream);

PdfHelper.Save(pdfDocument, filePath + @"\" + fileName);

}

finally

{

stream.Flush();

stream.Close();

stream.Dispose();

}

reportDocument.Close();

reportDocument.Dispose();

}

Best Regards.

Horacio

Edited by: hmontalvetti on Dec 16, 2011 5:25 PM