reporting-services

Eliminating extra / blank pages (they have headers) in reports in Microsoft Report Builder / SSRS 18.4


I will start by stating that I have read through and tried numerous suggestions without success. I have a report that is populated from a local SQL server and a data set. I have checked each of the "Row Groups" and they do not have any page breaks. I have a header and a footer as well as a parm field using a calendar. All of the data is correct. The issue is I am getting extra pages that have just the header and footer but no data or column headings.

I have made sure that my paper size is correct (see below) and that my work area is the same size, and in this case, slightly smaller than the page size minus the margins. I have it set to landscape.

Paper size and margins.

I have verified that the "ConsumeContainerWhitespace" is set to True. ConsumeContainerWhitespace

I systematically deleted each item in the work space, including the "Row Columns", while checking the resulting pages. After deleting everything in the work space except the link for the data (this breaks the report), the extra pages persist.

I tabbed through each item making sure none of them exceeded the work space size.

Can someone please point me in the right direction as to what I am missing! :-)

Thank-you in advance!


Solution

  • This is what worked for me: Open the .rdl file in a text editor i.e. notepad or notepad++ and eliminate the page break tag with the break location of "End", e.g.

    <PageBreak>
      <BreakLocation>End</BreakLocation>
    </PageBreak>
    

    Once I deleted this page break section, the extra page at the end of the report was gone.

    Edit... If you need to keep the page break then you can also add conditional code, like this, where I wanted to have a new page for each StockCode, but not an extra page at the end of the report:

                  <Group Name="table1_StockCode">
                    <GroupExpressions>
                      <GroupExpression>=Fields!RPT_ID.Value</GroupExpression>
                    </GroupExpressions>
                    <PageBreak>
                      <BreakLocation>End</BreakLocation>
                      <Disabled>=RowNumber("DataSet1") = CountRows("DataSet1")</Disabled>
                    </PageBreak>                    
                  </Group>