Solved

RDLC PDF Paging Issues

Posted on 2011-02-14
8
5,557 Views
Last Modified: 2016-09-12
Experts,

I have an RDLC report that I am using to generate PDF letters from a database.  Each letter (each record in the data source) should be on its own page, but may span multiple pages if necessary.  Basically, I have three fields that I use to generate each letter: AddressBlock, LetterDate, and BodyText.  The PDF file is generated from a windows app using the Microsoft.Reporting.WinForms.ReportViewer class.

I have used the below RDLC layout to generate the letters.  I just have a static header and footer, and one list in the body that contains three bound text boxes.

 Report Design
Everything has worked fine until I discovered that if the BodyText text box gets to be just the right size it will go off on to its own page, leaving the AddressBlock and LetterDate text boxes on the first page.  This does not happen if the contents are smaller (the letter is generated as just a single page), or if the contents are larger (the letter begins on the first page and spans across multiple pages).  In this perfect storm scenario, the contents of the BodyText text box are just long enough to warrant spanning to another page, but instead of the text box beginning on the first page and slightly spanning onto the second, the whole text box moves to the second page, and only the AddressBlock text box and the LetterDate text box are on the first page, with a bunch of white space below.


It is supposed to look like this (if the body can fit on one page):  Example 1-Page Letter

Or this (if the body is longer than what can fit on one page):  Example 2-Page Letter


but instead looks like this (incorrect):  Incorrect 2-Page Letter

I hope this is just something stupid, as I do not have a whole lot of reporting experience.  It has been driving me nuts for days...

Thanks,
Grant
0
Comment
Question by:gtporter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 18

Accepted Solution

by:
chrismc earned 500 total points
ID: 34894748
Assuming this is SSRS 2005, then this is a particular weakness of it!

You have one cell that can get very large. SSRS will do everything to try and keep that object together on a page.

There are some "Keep Together" properties on various objects in SSRS. You could experiment with that but I've found it a bit hit and miss.

You are probably better off trying to break that "Body Text" down into smaller pieces in your data query then displaying it inside a nested list box.
0
 

Author Comment

by:gtporter
ID: 34896913
Thanks for your response.  As this is a client-side RDL file (not SSRS-hosted), and I am using the WinForms ReportViewer class, I can use whatever version I choose, as far as I know.  This was developed using VS2008, but I do have VS2010 and ReportBuilder 3.0 at my disposal if newer versions would not have this issue.  Splitting the body up did come to mind, but that would mean changing a bunch of code and including logic on where to split cleanly, etc.  I would rather fix this at the report definition level.

Thanks,
Grant
0
 
LVL 18

Expert Comment

by:chrismc
ID: 34898275
Hi Grant
The later versions are supposed to perform a lot better. But I haven't used them in earnest so can't add any useful comment on that.
I understand your dilemma on splitting the data but if you have to go down that route I'd suggest splitting on paragraph breaks.

Cheers
Chris
0
Setting up LaraDock for Laravel

Learn how to set up LaraDock in a Laravel project - LaraDock gives us an easy way to run a Laravel application using Docker in a single command.

 

Author Comment

by:gtporter
ID: 34898800
I just tried VS2010.  Same story...  The version of the Microsoft.ReportViewer.WinForms DLL was 10.0.0.0 (runtime v2.0.50727).  Is this the latest version available?  I'm trying to avoid breaking up the string at all costs, but it's sounding more and more like that will be the only option.  I hate band-aids...

Thanks,
Grant
0
 
LVL 18

Expert Comment

by:chrismc
ID: 34898967
I know what you mean but on the flip side SSRS is a data reporting tool and not designed to be a word processor which is kind of what you are trying to do.
Not a criticism but if you look at it from that point of view it's more understandable.

I have reports that generate contract letters and I had to do the breakdown to make it format properly so I do feel your pain.

Cheers
Chris
0
 

Author Comment

by:gtporter
ID: 34899241
Oh, I hear you...  I was originally going to go with some sort of MS Word mail merge, but I determined that using a report would be more automated and easier on the end-users (we wouldn't have to teach them how to do a data-bound mail merge in Word).  I think I'll close this, as it seems like an easy solution was a pipe dream.  Thanks for your help.
0
 

Author Closing Comment

by:gtporter
ID: 34899267
While not the solution I was looking for, it did solve the problem.
0
 

Expert Comment

by:urvi chauhan
ID: 41793947
i have create page but when i convert report to pdf some text are missing in pdf
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question