Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5687
  • Last Modified:

RDLC PDF Paging Issues

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
gtporter
Asked:
gtporter
  • 4
  • 3
1 Solution
 
chrismcCommented:
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
 
gtporterAuthor Commented:
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
 
chrismcCommented:
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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
gtporterAuthor Commented:
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
 
chrismcCommented:
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
 
gtporterAuthor Commented:
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
 
gtporterAuthor Commented:
While not the solution I was looking for, it did solve the problem.
0
 
urvi chauhanCommented:
i have create page but when i convert report to pdf some text are missing in pdf
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now