SSRS giving a blank page at the end of report [duplicate] - reporting-services

This question already has answers here:
How to get rid of blank pages in PDF exported from SSRS
(16 answers)
Closed 5 years ago.
I am getting a blank page, at the end of my report in SSRS 2005.
I have a header logo and footer date values, and I have set the both to PrintOnLastPage = False, but I am still getting a blank last page.
Any ideas how to eliminate it? Thanks!

This solution applies for SSRS 2008 R2. I am not sure about earlier versions.
On Report Properties page, under category Other, set ConsumeContainerWhitespace to True.
Other suggestions still apply: Make sure your Paper Size can contain Report Width and Margins. Remove any white space you may have on your Report.
Good luck.

Shorten the width of the report, dragging the right vertical side to the left.

Setting ConsumeContainerWhitespace works, but may cause a catastrophic increase in report generation time, especially for very large reports.
An alternative solution is as follows and involves keeping track for yourself which record is the last record in your dataset.
SQL - Track Row Number vs. Total Rows
You may use a technique such as the above to track Current Row # vs. Total Rows, just make sure that your "Order By" mechanism matches that of your main select statement.
Add an end-of-record page-break to all but the last record
Add a vertically-tiny rectangle to the end of your report body
Rectangle Properties -> PageBreak -> BreakLocation -> End
Now, we want this rectangle to be visible when we desire a page break, and we want it to be hidden when we do not want a page break.
Thus, in the Rectanble Properties (right click) -> Visibility -> Show or hide based on an expression -> Expression Edit
=Fields!RowNumber.Value=Fields!TotalRows.Value
This will cause a page break to occur at the end of each record, except for the last record

I had a report that kept printing a second page.
Someone else had added the tablix and set a "Page Break" END property to the tablix.
When I changed this to NONE it solved the problem.

I had a report containing a subReport. The subreport had a 'PageBreak' property with the 'BreakLocation' set to 'Start'. Changing it back to 'None' removed the blank page I was getting.

Adding to what MikeGee had answered and considering this is a very old thread, I thought I would add my 2 cents.
To avoid blank pages, set each "BreakLocation" property of each tablix to "None". Sometimes it defaults to "End" and the number of blank pages depend on the number of tablix in your report.
For example if you have 3 tablix in your report and if each tablix has a "BreakLocation" property set to "End", you will have 3 blank pages.

set ConsumeContainerWhitespace to True if it is 2008 R2.

I had an image on the last page and when it's size was set to 210mm, 297mm (A4) it produced a blank page at the end of the report. But when I changed the height size from 297mm to 296.9mm the blank page disappeared. This was using VS2013.

Check your margins as explained above
+
If you have a tablix that dynamically adds columns to your report, check that the "runtime width" of you tablix is within your margins. At runtime, it may be larger than the body-width you specify in the designer.
(Note: it's impossible to do this with the designer; try reducing the size of your columns to see if the blank page disappear).

Related

SSRS - Shrink report width when hiding columns

Using SSRS 2013. I am able to hide columns with boolean values, but the report (body) width does not shrink when columns are hidden. Thus, there is excess blank/white space to the right of the report. Is it possible to eliminate this excess space? If yes, kindly will you please advise how?
The report body width - as with any column width and unlike heights - is a set value that cannot be changed on execution. You need to either put up with the white space, format your presentation layer to not be affected by the appearance of the white space or redesign your report so the objective of hiding the columns can be achieved in a different way.
I ran into this exact same limitation of SSRS. I was able to achieve what I believe you are trying to get (consistent report and report col width when certain columns are hidden due to parameter vals, etc.)- by simply having 2, separately formatted report tablix/tables in the report and hiding/showing based on a parameter (or some SSRS-expressible logic):
1 for the condition when all columns are present; 1 for the condition when some columns are omitted- both of them formatted to utilize all available screen real estate to minimize white space and make things look "clean".
Instead of hiding column(s) when my hidden condition is true- I simply show the 2nd tablix and hide the 1st. And when the filter changes to show all columns, I do the reverse (hide the 2nd tablix and make the 1st visible again).
Not sure if that helps, but I figured I should share if it might aid anybody else facing this issue.
PS: Your tablix Hidden expressions will look something like this:
[the full column tablix].Hidden
=iif(Parameters!parmOmitSomeCols.Value = true, false, true)
[the tablix with some columns omitted].Hidden
=iif(Parameters!parmOmitSomeCols.Value = false, true, false)

SSRS 2008 Removing white space when hiding elements

I have been trying to resolve this simple issue for a few hours with no joy.
I have two tables within my SSRS 2008 report which are bound to different datasets and I need to show or hide the appropriate table based on a passed in parameter. This I have done with the hidden property of the table which works as expected. The problem I have is that when hiding the top item and showing the item beneath it I get the white space from the hidden item.
Trivial example
I created two tables and bound them to the same datasource laying them vertically.
I then set the hidden property of the top table to true and previewed the report.
You can see that the first grid is hidden but the white space remains. From my investigations I did see the ConsumeContainerWhitespace property used for this but in my case it did not clear up the white space.
Question
Is there a method of removing the white space for these hidden elements?
I would recommend two solutions depending on whether the datasets are the same.
1: If they share a common dataset then I would nestle them in another table that has 1 column, and 2 rows, and then change the row visibility depending on the parameters.
2: If the datasets are different, I would make each table a sub-report and then change the visibility that way.
Just another workaround caused by SSRS quirks!
This can be fixed by ensuring that the reports ConsumeContainerWhiteSpace property is set to true.
This can be found in the report properties. Click the yellow surround for the report, press F4 to open the Properties pane, and you can find ConsumeContainerWhiteSpace under there.
See also ConsumeContainerWhitespace property to remove blank space in SSRS 2008 report
The behavior can be controlled by following method
1) Right click on the top left box on the tablix and click on 'Tablix Properties' to open the properties for the tablix
2) Click on the "Visibilty" tab on the left hand side of the wizard
3) Click on the "Show or hide based on an expression", click on the Fx and paste the following formula
=IIF(RowNumber("DatasetName")=0,TRUE,FALSE)
4) Make sure to replace the "DatasetName" with the your dataset name (the one that is related to the tablix)
5) Also make sure that the ConsumeContainerWhiteSpace property is set to "True"
ConsumeContainerWhiteSpace property is a report level property and can be changed from properties window for the report. (click on the report outside of the design area)
This worked for me very well.
Select the object, go to properties and set the size to 0,0
Wired. Only contained them in another tablix or subreport then it works in hide them with no white space.

Empty page when hiding tablix

I've got a number of tablixes and they hide/show expressions.
If we run the report for a particular dataset, the first tablix is shown on the first page and the data ends pretty much on the last line of the page.
The second tablix is hidden in this particular scenario but since I have left about 1cm gap between tablixes, this causes a new empty page to be created. Is there any way of removing this gap?
Move the tablix's closer together (basically remove as much whitespace as you can)
If you need more space when you are showing the tablix - add a row to the top of the tablix and set its visibility to false.
This is often caused by the feature of ssrs preserving whitespace around objects that are hidden
Check for the page breaks in the tablix properties. It may be there which is causing this.

SSRS - RDLC Tablix Rows will not split across pages

I have a tablix with two columns of data (the section name and the section text). The section text has grown so large for some sections that the row representing the section takes up 2/3 or more of the page. THe report prints fine until on of these large rows would have to split over the end of a page and continue on the next page. In this case, and only in this case, the rows leaves large amounts of white space on current page and start on the next page (as if it had a page break before it)
I have already set the Tablix General Property "keep together on one page if possible" to true and all the other page break options for the tablix and row groups to false, to no avail.
Does anyone know of a trick or work around to make the large rows split over pages??
Setting Keep together on one page if possible to true/checked will cause SSRS to attempt to keep the row on one page, which means if the data spans across page breaks it will move that row to start on a new page so that it can be seen on one page, which would introduce white space where the row would be if the table was contiguous. So you need this setting set to False/Unchecked.
Next, ensure that the row group proeprty Keep together is set to False. This can't be accessed through the normal dialog box. If you don't have the properties pane showing in BIDS, then pressing F4 will bring this pane up. Select the row group(s), and ensure the property is appropriately set.
Also make sure that the text boxes inside the tablix are also set to KeepTogether=False. This will fix the problem.

Get rid of page breaks in report

How do I get rid of the page breaks in an SSRS report, making the report display in a single page?
Open the report's .rdl file in a text editor and locate the <Page></Page> section.
In that section, insert the following:
<InteractiveHeight>0in</InteractiveHeight>
<InteractiveWidth>8.5in</InteractiveWidth>
In SSRS, an interactive height of 0 means the report has an infinite length and therefore, it will exist on a single page.
Make sure you do not have one of the properties set to true on one of your report items for PageBreakAtEnd or PageBreakAtStart. Also, make sure you keep the width of your report less than the width of your actual paper, keeping in mind extra space for the page margins (Report > Report Properties > Layout)
And according to Microsoft:
"Although it is not recommended, you can disable soft page breaks by setting InteractiveHeight to 0." I think this only works for HTML rendering though, I have not used it myself.
I'm not sure if there is a scale of any kind where no matter how big your report is it still prints on one page if that is what you are looking for.
Right Click anywhere in Body and select Properties.
select Reports From the DropDown. (When you select an element in report, the dropdown changes to TextBox/Header or the item you select)
In Report properties, Expand InteractiveSize Attribute.
Set Height -> 0in
If you're trying to display report data in one page, it is simple to do in SSRS. All you have to do is select an entire table and then go to the property pane. Update KeepTogather = True.
You can set the report's InteractiveHeight to 0 to disable paging.
Go to report properties -> Page -> InteractiveSize -> Height. Set this value to 0in.
Here is the similar question.
Dustin Brooks wrote:
Also, make sure you keep the width of your report less than the width of your actual paper, keeping in mind extra space for the page margins (Report > Report Properties > Layout)
Also be extra careful about this when working with subreports. I've lost count of the times I ended up with extra blank pages when I've accidently made a subreport wider than the main report.
When creating reports for the web, I would disable page breaks by setting the InteractiveSize to something really crazy, like 1000x1000". (I just checked, and setting it to 0x0" as Dustin Brooks mentioned in his answer has the same effect.)
I left the PageSize property at 8.5x11" and the reports printed across multiple pages normally.