user2351642
user2351642

Reputation: 21

Report loses page break when exporting to PDF Visual Studio

I have designed a report in Visual Studio using the Rectangle tool to display one record per page in the output. This works successfully when I run the report, however when I export the file to PDF, the page break seems to get lost. With subsequent records starting half way down a page containing the remaining data from the previous record. I should point out that I am exporting a "notes" field in the last section of the page (contained within the rectangle object) that can have unlimited characters. This is the reason why the report goes over a single page per record. I'm not concerned about that, but I would like to start the next record on a "fresh" page in the PDF output.

Upvotes: 2

Views: 2176

Answers (1)

adam
adam

Reputation: 119

I found your question after hitting this issue myself today. I managed to solve it but I'm not 100% sure how or why... I had several fields "inside" a rectangle, and that rectangle was set to "Add a page break after" (BreakLocation = "End" in Visual Studio designer properties). What I was experiencing was that if I exported my rdlc report to Word, it would look fine but if I exported to PDF the page break was lost.

What I ended up doing was scrapping that rectangle and created a new rectangle just after the text (where I wanted the page break to occur) and sized it to the width of the page and shrunk the height down as small as I could. It kind of looks like a thin horizontal line across the bottom of the layout. I then set this rectangle to "Add a page break after" and the page break now works in both Word and PDF exports.

Hope this helps!

Upvotes: 2

Related Questions