cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a timeout for Crystal Reports?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

former_member183750
Active Contributor
0 Kudos

Hi Robert

I believe there is .length you could check on the stream object and compare to a known size, but that is about all I can think of there.

As for timeouts, this KBA may still be valuable to take a look at:

1598378 - Is there a way to increase the timeout the InProc RAS SDK for VS .NET uses for large amoun...

The above KBA was written for CR 2008, so the reg key will have to be adjusted for CRVS (I don't have the right image running right now, otherwise I'd copy it here - sorry).

And the other thing to perhaps consider is; are there any obvious design differences between this report and those that run with no problems. Things like subreports, database connection consistency (e.g.; all use ODBC - including any subreports), page size, fields slipping off the design page(?), cross tabs, images, charts, underlays, etc., etc.

Oh, one more thing. What does actually happen with that report? Any errors? Behavior, symptoms? Any messages in the Event Viewer?

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

Ludek,

Enclosed below are two screenshots.  The first shows what actually appears when it fails - always after about 30 seconds.  The second is something I should have checked before: it's the Error Logging system I built into my app.  It's clear from that that the problem is entirely related to SQL Server timing out!

I just used SQL Server Management Studio to directly run the report's stored procedure.  It consistently takes 2 to 3 minutes.  So the big question is, why is it timing out after just 30 seconds?  I'll go to the ASP.NET forums to try to find out!

Thank you again for your help this past week.  Much appreciated!!

Robert W.

former_member183750
Active Contributor
0 Kudos

Umm, one thing to try (probably not the solution but it's sooooo easy to do); Enable the two options in the report - "Verify on 1st refresh" and "Verify SP on 1st refresh". Just a possibility that Crystal is seeing something in the db and just keeps on trying and trying and trying... Would be great if that solves it before the weekend

Have a great weekend,

- Ludek

Former Member
0 Kudos

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

Answers (0)