Showing results for 
Search instead for 
Did you mean: 

Server crash with multiple calls in IIS when export to pdf

Former Member
0 Kudos


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())




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

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

Stream stream = null;



stream = reportDocument.ExportToStream(ExportFormatType.PortableDocFormat);

PDFDocument pdfDocument = PdfHelper.AddAutoPrint(stream);

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











Best Regards.


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

Accepted Solutions (1)

Accepted Solutions (1)

Active Contributor
0 Kudos

Does not seem like a Crystal reports error.

Apply [SP 2 on CR for VS 2010|].

Take a look at the SAP Note

[1198587 - How to export a report to stream in C Sharp (C#) for Visual Studio .NET |]

How many users access the same report at a time?

Below article might help as well

[Crystal Reports Maximum Report Processing Jobs Limit|]

- Bhushan.

Edited by: Bhushan Hyalij on Dec 16, 2011 6:19 PM

Former Member
0 Kudos

We found the problem with two user at the same time. The application pool crash because it happens 5 times in 5 minutes. Then we configure the app pool with web gardering and it improved a little bit but crash with 5 users at the same time. Always crash at the same line.

We are testing it with a win32 that call with multiple threads and it crash some times with 2 or more users.

I will install the sp2.

Best Regards,


Edited by: hmontalvetti on Dec 16, 2011 7:52 PM

0 Kudos


It appears you are using the Report Engine, it has a 3 CPL report job built into it, no work around other than going to RAS to handle the report jobs or put caching in your code to cache the job requests. Something you have to manage.


Answers (0)