cancel
Showing results for 
Search instead for 
Did you mean: 

Server crash with multiple calls in IIS when export to pdf

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member188030
Active Contributor
0 Kudos

Does not seem like a Crystal reports error.

Apply [SP 2 on CR for VS 2010|http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_2.exe].

Take a look at the SAP Note

[1198587 - How to export a report to stream in C Sharp (C#) for Visual Studio .NET |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333133393338333533383337%7D.do]

How many users access the same report at a time?

Below article might help as well

[Crystal Reports Maximum Report Processing Jobs Limit|http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/f053713e-3e3d-2c10-2a81-f79259e54023]

- 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,

Horacio

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

0 Kudos

Hello,

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.

Don

Answers (0)