In my ASP.NET 4.0 Web Forms application, I've built a reports module that utilizes Crystal Reports to generate the reports, creating each as a PDF, storing it in a MemoryStream object, and then repopulating a window with the PDF.
It generally works very well. In fact, with 20 of 21 reports it works perfectly. But there is one in particular that occasionally does not work. Anecdotal evidence suggests that it fails when there is a lot of data, not necessarily in terms of rows in the report but in terms of computation time for the SQL Server Stored Procedure to do its work.
Trying to track down the problem, I'm working on the assumption that a timeout is occurring and the PDF is not being generated. I'm going to add some error handling to the code to address this. I'm also going to investigate SQL Server timeout issues. But I'd like to find out two things from the Crystal Reports experts:
- Is there a timeout value for any part of the Crystal Reports engine to do its work? If so, how do I increase it?
- This is the line that exports the report into PDF format into the MemoryStream:
memStream = (MemoryStream)report.ExportToStream(ExportFormatType.PortableDocFormat);
Is there something I can check to determine whether the PDF was successfully created?
Thanks,
Robert