Slide Up Visible Sub Reports in SSRS Report - reporting-services

I have an SSRS Report composed off datasets (tablixes) and subreports. How do I have the reports slide up when they are visible.
Report
A (NOT visible)
B (visible)
C (NOT visible)
D (NOT visible)
E (visible)
Visibility is set based on user input/parameters, etc. In the above example what will appear on screen is the tablix B / sub-report E. How I want it to appear is with out extra white space which it now has.
or in another scenario they could just pick E which is common and now we get a lot of white space at the top. What setting do I pick, what code can i write to have the visible rectangle of data slide up to the very top of available space.
So all we see is
Report
B
E
or
Report
E

When you've placed subreports on your page, did you make whitespaces between them? I belive you did. And now, when you hide one of subreport, whitespaces still visible and accumulate. You should reorganize your page by insert rectangles one below the other without (or minimum) whitespaces between of them. Put your subreports into each rectangle and add whitespaces inside it. Change expressions to control rectangles visibility instead subreports.
Don't forget: in spite of subreport is hidden, it is still retriving data and loads your server. To avoid it, pass visibility status to your subreports, to tell thems datasets to select null.
P.S. If you see extra white space in preview mode, it is not allways the same as browser will display. Especially if you hide object directly, without using expression.

Related

SSRS - Subreports leave blank white space if they have no info

I have several subreports that contain data that is either shown or hidden. This is how the design looks like:
As you can see, they are small but if one of the reports have no data, then the whitespace is still displayed when previewing the report:
I tested the subreports out by putting a solid black line as border and as you can see, the whitespace is generated even though the subreport returns no data.
How do I hide the whitespace?
You could nest the subreport in a rectangle and control the visibility of the rectangle based on if there are any rows returned.
=IIF(Fields!Field1.Value IS NOTHING,true,false)
You could show/hide Subreport based on Expression as
=IIF(RowNumber(Nothing)>0,False,True)

SSRS Reporting - How to repeat a series of different elements based on a parameter

I have a report with one input parameter, and based on that input, the report will have 1-3 different categories present. My issue is the report layout consists of the following elements: A header, 3 tables, and a bar chart.
What I am trying to accomplish is to repeat the above layout with ONLY categories available to the input parameter without leaving unnecessary whitespace. I've tried to achieve this by copying and pasting the layout three times and hiding the elements if the category does not exist. This works partially as I'm left with blank pages.
Instead of filling the report with a bunch of tables, try adding rows to the 1st table, adding a rectangle in that row, and adding a sub-report in the rectangle. Set the visibility of the rectangle instead of your 2 tables. This will ensure that there are no unnecessary white spaces.
Adding more than 1 table to a report has almost always ruined the layout of my reports. I've always added sub-reports instead. Even if you don't want to add a rectangle, just add a sub-report in a new row of your ONE table and that makes it a lot easier to deal with.

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.

Labels in fields within an SSRS report

I am attempting to reproduce a form within SSRS and fill it with data. The original form has blocks with small labels inside of each box that identifies the entry requested.
I "thought" I could simply use two different tablixes: one for the blocks with borders and labels, and the other one with the actual datafields or expressions, and align the 2nd tablix directly over the first one so that it appears as though the fields are presenting data inside of the labeled boxes.
It looked as I wanted it in design view, but when I went to preview the report, it pushed the 2nd tablix below the first tablix, in effect creating two tablixes, one stacked on top of the other one (not displaying as how I intended).
So, how do I accomplish the form design in the manner that I am seeking?
You should be using a type other than tablix for your report. Use a 'List' instead and you can free float objects as you need them and also nest a tablix as well. A little explanation on list:
You can float images with text boxes and then even change syntax or draw boxes around them and decorate those.
The call out for a field in SSRS is [(value)] with the [] meaning: "Data Column in recognized Dataset"
You can call out Variables with an '#' in front of them [#Test] would be a variable a user would put in called 'Test'.
Whatever size 'List' element is will determine how large it is when it repeats. If you want a strict form ensure the length and width are set correctly on the properties of that element.
If you want it to break every page you can click on the 'List' > Right Click the top left corner > Properties > 'Add a page break before' checkbox.
My example shows a super simple textbox with a dataset that only has three ideas repeat as many times as there are id's, three times. You can apply this to your form as needed.
It looks like you could reproduce that form header quite easily with a single tablix. If you envisage the form as a set of tablix cells like so:
then all you need to do is set the Border properties for each cell to hide the borders as needed (or you could merge the cells e.g those for Applicant and Location).
You can use a tablix with only Header rows, deleting the detail row. If you need multiple forms per report, then put the tablix inside a List region.