This is a migrated thread and some comments may be shown as answers.

Export to PDF Slow

12 Answers 162 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ed Lance
Top achievements
Rank 1
Ed Lance asked on 03 Jan 2013, 01:30 AM
This is an ASP.Net app with a page with a report viewer control on it.  The very first time in a session that you export any report to PDF, it is very sloooow.  It can take a minute, and this is on a very good production server.  Then, the next report you export is virtually instant.  Or go to another report, the export is still instant.

Anyone else notice this? 

Seems like this would be an issue of loading an assembly or something, then once it's there, things are fast.  This problem also exists in SSRS.  It is not a good user experience though and I don't think it should be like this. 

Is there anything to be done about this?  I was thinking a poor man's solution would be to script something that does an export periodically behind the scenes, just to keep the code loaded up in memory or something.

Thanks.

12 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 07 Jan 2013, 03:06 PM
Hello Ed,

I can't confirm the behavior that you observe. Is the same behavior observed with any other export format e.g. Excel? Have you checked what assemblies are being requested and loaded upon the first export operation? If the extra time is taken to load the assemblies that contain your reports into the current AppDomain, then the solution is as simple as referencing a single type from your report library like this:
Copy Code
public class Global : System.Web.HttpApplication
{
    ....
     
    protected void Application_Start(object sender, EventArgs e)
    {
        var t = typeof(MyReportLibrary.Report1);
    }
 
    ....
}

The code snippet above relies on the Application_Start method in Global.asax and its only purpose is to force the .NET runtime to load the assembly where MyReportLibrary.Report1 type resides.

Regards,
Steve
the Telerik team

HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Ed Lance
Top achievements
Rank 1
answered on 08 Jan 2013, 10:39 PM
I haven't dug into tracing assembly loading yet.  I think there is some confusion here regarding which assembly.

The report is loaded into the ASP.Net report viewer control.  Therefore the assembly, my .dll, containing the reports MUST have been loaded.  Then the user selects to export.  That is where the slowness occurs, the first time, indicating that there is something going on in the component, your .dlls, that gets loaded up and renders the report into PDF.  I don't know what, only that the first run is slow, then any folllowing that are nearly instant.

0
Peter
Top achievements
Rank 1
answered on 09 Jan 2013, 06:19 PM
I am noticing the same thing.  

It seems to take a long time to process this line:

Dim reportResults As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("PDF", instanceReportSource, Nothing)

My report does have a number of groups and conditional formatting.   The report is only 31 pages.

An excel export is much faster.

Peter
0
Ed Lance
Top achievements
Rank 1
answered on 09 Jan 2013, 07:46 PM
Peter,
Does this happen every time?  If you were to run that code twice in succession, would the second time be faster?
0
Peter
Top achievements
Rank 1
answered on 09 Jan 2013, 07:50 PM
Every time.   I am trying to remove things from the report to narrow down what maybe specifically causing it.  With 1 column and no groups, it renders 34 pages in about 5 seconds.   600 pages about 15 seconds.
0
Ed Lance
Top achievements
Rank 1
answered on 09 Jan 2013, 09:22 PM
Don't think this is the same thing I am seeing, as it is only on the first run. 

Also, 600 pages in 15 seconds seems pretty good to me.
0
Peter
Top achievements
Rank 1
answered on 09 Jan 2013, 09:24 PM
15 seconds with a 1 column, "cut up" report for testing purposes.  :-)

The "actual" report has about 10 columns, groups, etc, and that takes many minutes.

Peter
0
Ed Lance
Top achievements
Rank 1
answered on 09 Jan 2013, 09:40 PM
What I am trying to convey is that I see a difference between the first run and any runs that immediately follow it.
0
Peter
Top achievements
Rank 1
answered on 09 Jan 2013, 11:04 PM
Sorry,  I don't have that issue.  The reports run at the same speed whether the first time or subsequent times.

Peter
0
Hans
Top achievements
Rank 1
answered on 27 Feb 2013, 09:52 PM
Same problem for me, do you find a fix?
0
Ed Lance
Top achievements
Rank 1
answered on 27 Feb 2013, 10:14 PM
Have not.  I was hoping Telerik would engage with me on this.  I may submit a support ticket, but I'm not sure yet how to demonstrate the problem to them. 
0
Stef
Telerik team
answered on 04 Mar 2013, 03:38 PM
Hi everyone,

@Ed: We have tested to export programmatically approximately 100 pages and the result file is generated in approximately 8 seconds with slight improvements in any consecutive export. Please, open a support ticket and send us a runnable project illustrating the described export behavior if it is an issue for you.

@Peter: I believe we discussed your issue in a separate support ticket some time ago. What we said then was that we are aware of the performance of exporting large amounts of data and we have plans to revise that mechanism, but we should not forget that the main point in reporting BI solutions is displaying data in a human-readable format.

@Hans: Can you please elaborate to which issue you associate? If it is about the slow export, please check the Performance Considerations help article to see what can be done to fasten the export. You can also consider export to excel and csv where the export is faster due to the missing paging stage.

Let us know if you have any further questions or concerns.

Regards,
Stef
the Telerik team

See what's new in Telerik Reporting Q1 2013. Register for the March 4 webinar to witness the impressive new visualizations in Telerik Reporting. Just for fun, 10 webinar attendees will be randomly selected to win a Telerik T-shirt and a $50 Gift Certificate to ThinkGeek. Register now! Seats are limited!

Tags
General Discussions
Asked by
Ed Lance
Top achievements
Rank 1
Answers by
Steve
Telerik team
Ed Lance
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Hans
Top achievements
Rank 1
Stef
Telerik team
Share this question
or