Page Breaks Issue with PDF Rendering using SSRS 2008

已答复 Page Breaks Issue with PDF Rendering using SSRS 2008

  • Wednesday, December 03, 2008 4:22 PM
     
     

    We recently upgraded to SQL Server Reporting Services 2008 and are experiencing an issue with exporting reports in PDF format.

     

    Some of our reports have tables that are too big to fit onto one page. Using SSRS 2005, the table would start on the first page and then the extra rows would be pushed onto the second page. Now that we've upgraded to SSRS 2008, the entire table is pushed to the second page so there's a big empty space on the first one.

     

    We also have reports with subreports (with a page break before each instance of the subreport). In SSRS 2008, there will be random pages midway through the report file where the page breaks are totally ignored.

     

    We are running a parallel install of SSRS 2005 with the same exact RDL files, and the reports render perfectly fine on there.

     

    Any assistance is appreciated.....

All Replies

  • Friday, December 19, 2008 12:02 AM
     
     Answered
    Hi Justin - there are some behavior changes and defect fixes made between 2005 and 2008 in pagination logic. You should be able to alter your report slightly to achieve the behavior you desire. Open your report in the 2008 designer and check the KeepTogther properties of your data region (tablix) and any row groups. These control the behavior to forcibly keep items lumped together on the same page. Another common problem is horizontal whitespace. You might have blank space defined to the right of your data region that is larger than the width of the page. This will trigger a horizontal page showing that whitespace. Last thing to check is page breaks, you could have one defined on one of your groups to page break at start.

    Hope that helps
    -JonHP
    Microsoft SQL Server Reporting Services
  • Thursday, January 22, 2009 10:35 PM
     
     
    I'm having a similar issue, and I cannot for the life of me figure out what I'm doing wrong. The report I'm trying to create is essentially a horizontal table spread out over a couple pages - something I've done countless times in SSRS2k5. The report is sort of a status report for phone sample, showing counts of records for each classification. There is a row for each record classification type (completed a survey, told us to call back, did not answer, phone disconnected, etc), and then across the top we have six months of data, each month broken into 2 record classifications (record type 1 and record type 2). Since we're not using the built-in aggregating of the tablix, all of the math and grouping and aggregation is done in the database. The data set for the report has each classification as its own field and then all of the individual records keyed by month and record type - basically a pivoted version of the report. We also put a page number into the dataset so we can force the page break to happen at the right place.

    On the report itself, I have a list (tablix) with a row grouping on the dataset-supplied page number, keep together = true, and a page break being inserted between each instance of the group. Inside the list I have a matrix (tablix) linked to the same dataset, with column groupings on month and then record classification as a child group of month. When the report renders to the reportviewer window, it looks fine, but when I choose print layout or render the report to PDF, a blank page is inserted after each page of data, making my 2-page report four pages (one good, one blank, one good, one blank). Obviously the first thing I tried was cutting down the tablixes themselves, and removing the margins, and making sure it's all oriented properly -- but it's just not doing what I want it to do.

    If ANYONE can shed some light on this, I'd be much obliged. I've never had this problem in the past so I can only assume a change in SQL 2008 is more than likely causing the issue.

    Thanks in advance.
    Adam
  • Tuesday, February 17, 2009 10:41 PM
     
     
    Adam,

    Similar issue here. Have a report that was converted from SSRS 2005 to 2008. Upon rendering in 2008 and exporting to PDF, each detail row has significant whitespace between each detail row inside the group. The extra whitespace appears to be precisely the amount of space occupied by the group footers for subtotals, but yet, they should not be showing for the detail items, right?!

    Frustrating as this has completely ruined a great looking PDF export subscription we had going. Really looking for some help here as the hair pulling is bound to start soon. ;)

    Blessings.
  • Tuesday, February 17, 2009 11:08 PM
     
     
    Tech4Him - I actually solved my problem a while back. Stupid oversight on my part really. The root of the issue was this: I had a bunch of header stuff on the landscape-oriented report that spanned about 10". The total width of my matrix was maybe 3". The matrix would expand to the right one column at a time, but the rendering engine then sees another 7" or so of white space it needs to render, pushing my report way too wide to fit on a single page, therefore inserting a blank page between each "real" page. The reason I hadn't encountered this in SSRS2005 was because the layout of the reports I had been doing there was different - they had more "stuff" to the right of the matrix, and the page header only had a title, which was centered on top. So, the extra stuff to the right extended about as far as the right edge of my title, and that was as wide as I made the report body, which still allowed just under half a page for the matrix to do its thing before running out of space.

    Unfortunately, there's no great solution for this. Since my report was a pretty straightforward one, I pivoted the data in my stored procedure and then pulled it into a table instead. It felt like kind of a crappy compromise, but I couldn't find another way to have a header the width of the page that would allow me to put the data into a matrix instead of the table. Maybe a subreport? I don't know. I didn't want to try that for a number of reasons.

    Adam
  • Thursday, February 19, 2009 6:38 PM
     
     
    I, too, converted over 250 reports from RS 2005 to RS 2008.  They seemed to work fine until modification was needed.  Now the reports that have needed modification will not start their table or listing on the first page.  What is going on?  This is extremely frustrating.  All of the reports that had tables or listings have been replaced with a tablix with the conversion.  What is a tablix and why is it acting so differently then a simple listing or table (which is what most my reports are).  This 'upgrade' has cost me many hours of work and I still do not have any modified reports working.  By modified, I mean I changed the expression within a text field within the tablix.  Now the headers and not starting on the first page are making my life a living hxxx.  Also, the interface within Visual Studio is terrible.  No gridline, rulers, etc.  You call this an improvement?    
  • Monday, February 23, 2009 10:21 PM
     
     
    Hi,
    I have a problem with SSRS 2005. 
    I have a report which is about 2 pages tall and 50 pages wide. When I print, SSRS goes Over and then Down. I want it to go Down  then Over.
    It seems in SSRS the default page rendering is set to "Over then Down"
    Can anyone help me alter it in SSRS?
    Thanks,
    -SG
  • Tuesday, July 21, 2009 5:23 PM
     
     
    Adam Schmidt is absolutely correct in his post, but I'm not sure that it was absolutely clear.  I had the same issue with a matrix (tablix) which contains a rolling 12 month table of data.  This was already set to print on landscape/legal due to the length of the crosstab, but when exporting to PDF, there was an extra page break after every page. 

    The issue was I had a page header that I set to span to 13 inches in order to center the text of the page header over the final render of the report.  It appears that SSRS takes the length of the page header and ADDS it to the dynamic length of the tablix, thereby exceeding the page width.  I had set the interactive size to all zeroes, the margins to all zeroes, as was suggested in SSRS 2005, to no affect.

    After I shrunk the page header to the width of the matrix in design mode, the extra page break disappeared.  Now, my header isn't centered, but I am wondering if there may be a way to set the padding of the text within the header programmatically (in the expression dialog) to be the width of the page minus x amount...we'll see.

    Vince
  • Tuesday, November 30, 2010 2:15 PM
     
     

    I am running into the exact same problem when rendering into PDF. The PDF format is Landscape with a page width of 11" and a height of 8.5". The page has margins set up for 1/10 of an inch both left and right. The body of the report itself is only 10.3 inches wide, with zero margins. The tablix is 9.8" in width. The header width fits within the body just fine...

    I am continually getting a page break between each group. I have tried the setting of interactive sizes to all zero, and had no effect

    Have no idea what the deal is...!


    A. M. Robinson
  • Sunday, December 05, 2010 5:54 PM
     
     

    Hi,

    What was the solution, anyone!!!

  • Wednesday, February 02, 2011 1:26 AM
     
     

    Has anyone heard from anyone at Microsoft about this?

    This is clearly a bug with Reporting Services. I have a customer that specifies a company logo in the upper right corner of all reports. Not a big problem I would have thought. We produce reports from their OLAP cubes and go to a lot of trouble to make them look professional and fit pages etc...

    "I'm sorry but you'll have to change all of your documentation standards because there's a bug in your new reporting platform." is not an acceptable answer to any customer, Microsoft.

    We haven't heard from anyone on this for two years now. Is anyone as frustrated as me?

  • Wednesday, March 09, 2011 1:43 AM
     
     

    Judging by the number of folks posting "I have the SAME problem", it seems Microsoft HAS an issue that nobody wants to admit to...

    I just changed from portrait, which rendered a single-column tablix with a chart in the header PERFECTLY on ONE PAGE, to landscape and now I get 2 pages per chart...

    • Page margins are .25 top and bottom, and both sides.
    • Page header is 1.5"
    • Page Footer is 0.75, leaving 5.75" for my tablix.
    • Tablix is 5.5" deep by 11".
    • Changing the Tablix to 10.5 makes no difference.
    • Setting all the "Keep Together" = True, makes no difference.

    As a FRUSTRATED poster put it... "What is the solution", 'cos the so-called "answer" AIN'T IT, MATE!

    Clues, anyone???

  • Tuesday, May 24, 2011 4:08 PM
     
     Proposed

    I was about to add my voice to the growing number of individuals having this problem. I had checked EVERYTHING; margins, tablix width, headers, footers, Keep Together, all of it. Everything said I had more than enough space, it was obviously a bug.

    Except it wasn't, and I was kind of an idiot.

    Before you write this off as a bug, make sure you check one last thing. The Body properties. Right click on an empty space on your report to bring up the menu, and select 'Body Properties'. Take a look at the size. If it's wider or longer than your page size... there you go. That white space you see when designing the report isn't just there to give you a palette to draw upon, it's representing your page, and if it's wider or longer than your paper is, it'll give you a blank page as it tries to accomodate what you've asked for.

    I shrunk mine down, and it made my 'missing page bug' go away.

    This may not work for everyone (again, I was missing the obvious), but it might just work for you.


    If at first you don't succeed, skydiving is not for you.
    • Proposed As Answer by McBeth007 Tuesday, November 08, 2011 3:31 PM
    •  
  • Tuesday, November 08, 2011 3:37 PM
     
     

    I've been having a similar problem with page breaks in SSRS 2008 when my reports are exported to PDF or printed. 

    I tried Zebulon Pi's solution which almost completely fixed my problem!  I went to Body Properties and set the size I wanted it to be taking into consideration the headers, footers and margins.  The extra blank pages between real pages went away completely.  I still, however, have a few random page breaks but at least the blank pages are gone.  I believe there is still some sort of bug that Microsoft should look into.

    Thank you, Zebulon!

  • Saturday, January 21, 2012 11:42 AM
     
     

    I also have the same issue. My report is set to A4 (210x297mm) size, the body is set according to it: top/bottom margins and footer sizes are excluded from its height. It worked fine with the old VS2008 (Microsoft Reports V9), but after upgrading everything to VS2010 (MS Reports V10), I'm experiencing this. The details are:

    • the tablix is located in the middle of the page, there are controls above and below
    • the data consists of changing number of rows (it's kind of a loan planner calculation with dates, amounts etc.)
    • I'm using print preview renderer, this is required, as my reports must be exported to PDF
    The cases are:
    1. if the table fits in the remaining space (~120mm), then everything looks OK, no extra page break
    2. if the table does not fit in the remaining space, but fits on one whole page, I get an extra page break and a big, unwanted white space on the first page, and the table starts on a new page
    3. if the table does not fit in even a whole page, then everything is OK again, the data is displayed from the middle of the first page to the end, then there's a page break, and it continues on the next page

    My question is: how to get rid of the extra page break in case 2? Setting KeepTogether does not help, I've tried every setting on rows, columns, groups, tablix, but no success.

  • Wednesday, February 29, 2012 10:07 AM
     
     

    Hi Goose-T,

    I am facing the same problem like you.

    Did you find any workaround/solution for this?

    Please respond.

    • Proposed As Answer by rcm007 Thursday, April 19, 2012 12:59 AM
    • Unproposed As Answer by rcm007 Thursday, April 19, 2012 12:59 AM
    •  
  • Thursday, April 19, 2012 1:06 AM
     
     

    I was having an issue when exporting to PDF.  My tablix had a large amount of line items.  It was producing a page break and leaving a large amount of white space on the previous page.  I found the issue by looking at the grouping I had created in the tablix.  I selected my grouping and viewed the properties and found it had a keep together = true.  I set this keep together = false and the reporting starting printing in PDF as desired.  Best way to check this is to highlight the tablix then in the group view at bottom of visual studio select your groups and then check the properties there is a keep together under Other.

  • Saturday, July 14, 2012 11:08 AM
     
     

    Same issue here :-(

    I have a main report with details. The last detail is a subreport containg images. The image area is fixed for one per page and set to scale the images to fit. If I run the main report without the subreport and save to PDF, pagination is fine. If I run the subreport directly and save to PDF, the report is fine. When I run it as desinged I get seemingly random page breaks within the subreport.

    I scrapped everything and wrote two new reports. Results weren't exactly as I wanted though. The first page of the subreport would start on the same page as the main's details. I added a page break to the subreport and started getting the extra breaks. When I removed the page break however, nothing changed. It seems once you select a page break you can't truley get rid of it.

    I've tried everything including making sure Keep Together is set to false for all groups. Presently all page break options are turned off. I have one blank page before the first subreprot page and then one blank page between each real page.


    Chuck Stoner


    • Edited by ChuckSto Saturday, July 14, 2012 11:11 AM
    •  
  • Thursday, August 02, 2012 7:07 PM
     
     

    Almost same problem (and some solution)

    I have a report which displays a pie chart, when I was trying to export it in PDF it was fetching a 28 page report (in reality it has only 1 page). every row from tablix was getting displayed on 1 page so for 8 rows it had 8 pages and some page breaks.

    After reading the posts here I tried trimming the Margins (Left, Right, Top and Bottom to 0in) in report properties and now it has 2 pages only (god knows how this can happen, just doesn't make sense to me) however now my job is to get it in 1 page as there is an abrupt page break in my tablix and I tried all stuff like Keep Content Together True and False but nothing works.

    What amuses me is Microsoft's response on this, it's 2012 and I see people has been complaining this since the inception of SSRS 2008 and still such small issues is not being addressed, also if I try to export this report on word doc it comes just fine so no clue what's going on.


    • Proposed As Answer by Mary Jo C Friday, August 31, 2012 11:05 PM
    • Unproposed As Answer by Mary Jo C Friday, August 31, 2012 11:05 PM
    •  
  • Friday, August 31, 2012 11:12 PM
     
     
    After much hair-pulling, the following worked for me when I export to PDF.  On the main report, and all subreports, I set "Consume Container Whitespace" to true.  This is a property on the Report itself.  I also had to reduce the Body size on all subreports to slightly LESS than PageWidth - (left margin + right margin) of the main report