SSRS Report exported to PDF – Report page is split into multiple pages
Hello guys,
This is very common issue we face in SSRS regarding layout of report. I donβt know what to call this, whether a simple issue or strange requirement of client/user.
Let me tell you the problem definition first.
If we have a SSRS report with many columns to be displayed on it, it will expand horizontally. And after exporting these kinds of reports into PDF file format, you will see that pages have been split in multiple pages. But business users want to see one report page in one single PDF page and not in multiple pages.
Why I call this as strange requirement: Well, think of the scenario when someone asks you to put a table in single A4 size paper with lots of columns in it. And these columns should have proper width; contents of them should be visible etc. I am sure that A4 page would look messy. And even if we use the smaller fonts, we can make that a little less messy.
Solution:
In SSRS Report Layout, go to “Report” menu and select “Report Properties”. You will see dialog box as shown below. Just modify (i.e. increase it to your required level) the size of the “Page Width” and thatβs it. (This value is in inches)
Note:
Just by increasing the size of “Page Width” does not guarantee that exported page will fit into one page in PDF file. But itβs more like a trial-error method. So you have adjust is again and again till the page stop splitting into multiple pages. That means, you increase the size to 10in and test your SSRS Report by exporting to PDF. And if the page is still split, then increase the size again π
Disadvantage:
The only disadvantage with this method is, (and which is obvious) contents will be shrink in the exported PDF page. To see the contents in little good version, you better take the print of that paper in bigger paper (e.g. A3) as well as use the “Orientation” to “Landscape” while printing the page, so most of your contents will be properly visible and readable.
Hope this helps.
Thanks, Khilit
I just added this weblog to my rss reader, superb stuff. I like your writing style.
Thanks π
Hi,
I my report I have some content to be shown in portrait format and some in landscape and when I rendere the same in PDF it should maintain these format. Please suggest if any one have any idea.
Thanks in advance
hi jayesh,
how are you doing?
well, your issue is quite a brain-teaser. but this is not achievable through SSRS due to its limitations. And which is obvious too because we need to understand its capabilities and must not compare it with ASP.Net applications.
here are some references you can go thru:
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/4d17346b-c4d0-4e47-9ba4-d57ad9ffe08e
http://stackoverflow.com/questions/11087847/how-can-i-render-a-report-as-a-pdf-with-different-page-orientation-and-include
however, i have few ideas/suggestions that you can try:
1. two different reports for your two different layouts
2. if exporting to PDF is that much necessary then you can export some part of Report (e.g. first matrix) in one excelsheet and some part (e.g. second wider matrix) in another excelsheet in single excel file. and later by using C# code, you can convert them into PDF sheet by sheet. i dont have any working model of this.
3. re-analyze your requirements and try to make one symmetric report structure, which can make everyone happy π
thanks & tc,
khilit
Hi Khilit,
My business has same requirements to see all report columns fit in one PDF page width.
Thank you for sharing this hint how to achieve it. It is very helpful.
Hi Khilit,
I have a single report with four datasets and I am displaying data from all four datasets in four tables. And when I export this report to pdf file I want to see data coming from each dataset in a new page i.e. when I export the data to each new table should starts in new page. Can I do that?
Thanks,
Santosh
hi Santosh,
could you pls send me a screen-shot (bigator.blog@gmail.com), so i can see how 4 datasets are being displayed right now on Report.
Because you can do settings for how SSRS report can be displayed while exporting to PDF, but it based on the structure of the tablix (objects)’s layout.
Thanks, Khilit
Hi Khilit
This really great. I spend lot of time today find a hack to fix it. But everyone on the web has is talking about the bank page how to make it view in one page on report viewer. but now one actually talked about this issue, which is actually very common issue in the industry. Thanks alto for this blog post.
Hi khilit
I am new to ssrs report viewer, i was able to display the records in viewer but my problem was when i tried to export the report, the data is splitting into two pages instead of one page. can u please help me in this issue how to fix. i tried all the possible scenarious but all went into vain.
i am trying to generate report with the following assembly :
Microsoft.ReportViewer.WebForms and my code looks like this in aspx page.
thanks in adavance