Welcome to MSDN Blogs Sign in | Join | Help

Exporting as PDF from Report Viewer control returns dramatically different file sizes

Here is an interesting tidbit I picked up today that concerns the Report Viewer controls.

Mohammad Farooq, one of our fine support folks, noticed that the same report exported as PDF from our Report Viewer control was a different size depending on the rendering mode being used by the control.

When rendering a report from the server via the control, we got a svelte 300 KB file. However, when you put the control in local mode and exported, we got a 20+ MB PDF!

This behavior is due to the fact that PDF documents are (normally) compressed when they are generated. This compression logic lives on the server-side (inside the SSRS code), but not in the Report Viewer controls. So, if you use the Report Viewer controls to render a "server report", you enjoy the benefits of "server-side" compression. If you don't, you get no compression.

Published Tuesday, November 14, 2006 2:48 PM by russch

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Exporting as PDF from Report Viewer control returns dramatically different file sizes

Thursday, November 16, 2006 5:17 AM by Fatherjack

Can you tell me how to best set up RS so that we make benefit of the server side compression please? I dont quite follow the distinction you are referring to...

# re: Exporting as PDF from Report Viewer control returns dramatically different file sizes

Thursday, November 16, 2006 8:47 AM by russch

If you use SSRS "normally" you don't have to worry about this. The only time you would run into the issue is if you display reports via the VS 2005 Report Viewer controls, and you specifically set the controls to render reports locally vs. using the default behavior which renders reports displayed in the control on the server.

If you render reports which have been stored on the server, no problems. If you render from RDLC documents, you'll have this behavior, and there's nothing you can do about it except publish your reports to an SSRS server and use the server to do your rendering for you.

# re: Exporting as PDF from Report Viewer control returns dramatically different file sizes

Monday, December 18, 2006 4:20 PM by Kevin Lowe

I've looked this up on Google, and saw a bug report indicating this behavior is "by design".  

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=116726

That's pretty lame - it makes the PDF export function absolutely useless.  Is there any chance that MS will reconsider and port the compression code to the ReportViewer control?

# re: Exporting as PDF from Report Viewer control returns dramatically different file sizes

Wednesday, December 20, 2006 11:10 AM by russch

I agree -- it's not a good thing. And yes, this is on the product team's radar, but I don't know how high on the "to do" list it is...I wouldn't hold my breath.

# re: Exporting as PDF from Report Viewer control returns dramatically different file sizes

Wednesday, January 24, 2007 1:27 PM by Christopher

snapApps does have a fix for this if you have the option of using an external export button.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1138832&SiteID=1

You can download it from: http://www.snapapps.com/Components.aspx

# re: Exporting as PDF from Report Viewer control returns dramatically different file sizes

Thursday, October 16, 2008 10:13 AM by jbadmin

I am also trying to find out where I can make this setting change. I'm very new to SQL Reporting Services. I was tasked with installing it for the first time and have this exact same issue but Im' not understanding exactly where it is I need to go to correct this issue.

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker