Skip to Content
author's profile photo Former Member
Former Member

Is there a timeout for Crystal Reports?

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:

  1. Is there a timeout value for any part of the Crystal Reports engine to do its work? If so, how do I increase it?

  2. 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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2014 at 02:14 AM

    It appears that the default timeout of SQL Server is 600 seconds. The problem report is complete within 30 seconds, so the problem must be something else.

    My focus now is on Q2: Is there something I can check to determine whether the PDF was successfully created?

    Robert

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Problem solved! One line of code added, the fourth one here:

      SqlConnection conn = ConnectionManager.GetConnection(); SqlCommand command = new SqlCommand(procName, conn); command.CommandType = CommandType.StoredProcedure; command.CommandTimeout = 600;

      It's one of those things I've never had to worry about before. Now I learned something new!!

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.