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

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.

Related

RDLC report, How to combine the bottom of tablix with page footer

Help me please.
A Tablix has 7 rows but I need to increase height of tablix until it matches the footer.
What should I do?
[Edited.]
According to below figure, I tried to insert a lot of blank rows to a Tablix.
And I used an Expression for setting visibility each row.
Example :
-If Dataset has one record. One Blank row will hide.
-If Dataset has two records. Two Blank rows will hide.
But It is inflexible because some rows aren't a single Line.
Using RDLC 2005 you can simulate this behaviour with:
a Body section with Body.Height = Page.Height - Footer.Height - TopMargin - BottomMargin
a Tablix without border
a Rectangle for every column to simulate with Rectangle.Height = Body.Height; set its RepeatWith property to Tablix
In order to simplify some operations you could put your Total textbox in the Footer or consider it when you build your Body section as explained before.
There is an example of what I mean (Tablix with red border and Rectangle with black border):
Another, though more complicated way, of forcing the height would be to use Subreports for each of the columns.
Each Subreport would list the table contents for that column as a single list.
You could then force height of a single table row to reach the footer... If the Subreport does not require the entire space it will return whitespace
Parent Report
Report 5
Report 4
Results in the following output report

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.

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.

RDLC : No page break - four sub reports within table/tablix

I have a situation where i have to display four reports based on checkboxes. So user can select different combination from four reports.
My problem is page breaks. I have tried different options (see below) from which two options (option 1 and 2) does not give page breaks at all whether option 3 gives page breaks for each tablix regardless of you do not want to see that report. Report is giving empty page for each tablix no matter there is no data in that tablix to be displayed.
With option 3 if i select all reports to show then everything is perfect.
I have tried these options
Option 1 (page break does not work)
Main Tablix -> each row : all subreports within rectangle within each row of tablix
option 2 (page break does not work)
Main Tablix -> each row -> Another tablix with group by ID within each row of tablix and then subreport inside each tablix. And I applied page break end on each tablix.
option 3 (page break works but gives empty page for non selected reports)
A List group by ID -> within a single row of this list I have places four tablix group by ID for each subreport.
Option 3 works but gives empty page break for those reports which are not selected. For example from Four reports if you select last two reports to display then you will get two empty pages in the beginning of report and third report on third and fourth report on fourth page which is correct. I have tried hiding tablix using table hidden and group properties hidden but still getting page breaks.
Any help will be much appreciated.
I have resolved this issue. For those who are struggling with same kind of situation, here is my work around.
I placed one list box and then four tables in a row and i placed subreports within these tables. i didn't apply any page break here. I am only showing and hiding tables based on report selection here.
Trick is within subreports.
As there were lots of tables and groupings in each report so i placed one table at the end of the each subreport.
This table should only have one cell. I removed header and 2 extra columns which were not required. Select dataset for this table. I did not want to pass dummy empty dataset so I selected my dataset but I created grouping on a parameter which I was passing from parent report and it has value 1. So now this table will only display 1 empty row. Reduce the height of the table. Plus I removed the border of textbox inside the cell. I checked 'Page break at end' option. In the Hidden expression I used following code which checks if there is any report which is visible after this (current) report. If yes then do not hide this table mean you want page break otherwise hide it mean no page break.
=iif(Parameters!AddReport_2.Value,false
,iif(Parameters!AddReport_3.Value,false
,iif(Parameters!AddReport_4.Value,false
,true)))
This solution works for me.
I would love to hear for a better solution.