SSRS hide white space from empty textbox outside of tablix - reporting-services

I'm new to both SSRS and development in general, and can't seem to find the answer to my problem. The report itself is simple-- a stored procedure collects responses and I display them using Lookup expressions in textboxes. Some fields are not required, so some of the textboxes are empty in my report. I would like to remove the white space left by the empty textbox.
In retrospect, I wish I had used a table to format the page, but since I have a very large number textboxes with expressions, I can't easily refactor my work. I found solutions for tablixes (Trying to Get Rid of White Space in SSRS Report), but nothing for free-standing text boxes.
Is this possible?

If you right click on the textbox and navigate to 'Textbox Properties...' you can toggle the visibility of the textbox, and if it is hidden you wont see the white box. You could also enter expressions, like the one below for example will hide the textbox if there is no data in it.
=iif(isnothing(reportitems!Textbox1.Value),false,true)

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)

Add a page to SSRS report

I want to add a page to SSRS report, which can be toggle on/off based on a radio button selection.
The reason I want to add a page is so I can add additional report logic information for the functional users. Is it possible to add a page (with several text boxes) in SSRS report and show/hide based on parameter value?
NOTE:* One approach I could use is to add a rectangle and control its visibility via parameter. However, when hidden, it leaves a blank space behind. Is there a way to get rid of this blank space?
You can do this with a table component. Add a detail row and a footer row and set the dataset to read from SELECT 1=1. You can put a rectangle in the rows and build out your report in the first row and then optionally show/hide the footer row.

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.

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.

First Textbox in Tablix cell defeats CanGrow of other Textboxes if it spans page break

I'm having a problem with the way SSRS handles long text in Textboxes inside a Tablix when the first Textbox is broken by a page break. Here's the simplified setup:
Create a Tablix with a single cell.
Add a Rectangle to that cell.
Add 2 Textboxes to that Rectangle, one below the other.
Ensure CanGrow = True for both Textboxes.
Add data to each Textbox such that each one contains multiple lines and the first contains enough lines to force some of it's lines past the end of the page. It helps to set the Page height to something ridiculous like 1 inch for testing purposes.
It's necessary to preview the report in Print Layout mode or export it to PDF to see that all the lines in the first Textbox print, but the second Textbox only prints the first line. Taking enough lines out of the first Textbox to avoid splitting it across a page will allow the second Textbox to print all of its lines.
Am I missing something? Is there a way to get the Tablix to behave properly across page breaks? It's the Tablix because moving the Rectangle and Textboxes outside of the Tablix fixes the problem. I don't see a CanGrow or similar property on the Rectangle or Tablix. A workaround is to put each Textbox into its own Tablix row, but that's not ideal in my situation.
I was able to reproduce the problem, but looks like there is an easy workaround:
If you nest a second rectangle in the first, and then nest the second text box within that rectangle, my pdf came out correctly. I tried this with BIDS 2008R2, 11x8.5 (landscape) pages.