How to hide one row in a rowgroup? - reporting-services

I have a report in SSRS 2008 that has the following structure:
List
Tablix
Row Group
Row1
Field
Row2
Subreport
Is it possible to completely hide the first row in the row group, based on some condition?
I can hide the row, but the empty row still takes up space, I want the empty row to take up no space at all.

Part of the answer is given in the discussion that this question links to:
Try to set the Hidden property of the Static Row Group under the Details Group, in this case the whole row will disappear instead of the content of the textboxes.If you are using Report Builder, you need to switch to Advanced Mode (make sure that the Properties and the Grouping windows are displayed, go to the upper right side of the Grouping window and press the black triangle), click on the second "Static" item under the "(Details)" group and you can set the Hidden property on the Properties window.
However, this causes an exception when trying to export the report as PDF.

you can write an expression for the visibility of row.

Related

Display nested headers dynamically in SSRS?

Is it possible to create a nested set of headers in a Tablix in SSRS.
Such that in the first level grouping (Source), it shows a header of Count and a value for the total count of that group (source).
If you expand out the Source group, it would display the values inside the group, with a header that only displays when you expand the group?
I cant seem to nest the groups correctly. Do i need to use additional Total rows within the group?
If I've understood correctly, the easiest way is to build the report fully expanded with all the detail (and the totals you want to see when expanded).
Right-Click the row header, choose properties and set the row visibility for the rows you want to hide to hidden
Finally, in the same dialog, set the 'Display can be toggled by this report item' to the textbox you want to click when expanding the group.

Hide multiple rows or columns in SSRS report with same Expression at same time

I have a report containing a Tablix/table with sets of rows and columns which I am hiding conditionally using Expressions, via the Column/Row Visibility dialog.
If for example I have 3 columns which I want to all have the same Expression to determine their visibility, is there any way for me to achieve this without opening the Column Visibility dialog for each Column and entering the appropriate Expression?
I've tried selecting multiple columns, but then the right-click context menu no longer offers the Column Visibility option (it's greyed out) and I have also tried out the Hidden property of the columns (which can be amended in bulk by selecting multiple columns), but this only stops the columns from being rendered, leaving a blank space where they used to be (rather than how Column Visibility works, where columns to the right of the hidden columns are moved across to fill the gap, like hiding columns in an Excel sheet).
Is it possible to achieve what I'm after, or will I have to continue opening the Column/Row Visibility dialog for each column/row I wish to conditionally hide/show?
If the columns you want to control the visibility for are next to each other, you can create a Column Group for them and manage the visibility via the Group.
Add a new column group at the appropriate level so that only the relevant columns will be included.
If you already have Column Groups this will likely be a Child Group or an Adjacent Group.
If not, you can create an initial Column Group by dragging a Dataset field from the Report Data into the Groups pane.
Insert new columns inside the new group, and move the data from your existing relevant columns into the group.
The new group does not need to repeat, so in it's properties window set Group on: to a plain text value, e.g. "1".
Input the desired visibility settings into the Visibility page of the properties window.
For each of the individual columns inside the group set the Hidden property to False, to remove any other expressions or settings that might interfere.
Not exactly what you are looking for but perhaps a midway point - and this can apply to many things other than visibility (e.g. background colour, tooltip) - edit the RDL directly using View Code. This has the added benefit of being able to implement changes that are almost identical per column instead of identical with a minimum of mouse usage.
Typically I have set one column up the way I like it in the designer and then copy/paste under the other columns. In the case of visibility look for <TablixColumnHierarchy><TablixMemebers>. You will see a list of empty <TablixMember /> items along with the expanded <TablixMember><Visibility><Hidden>=... block where you have set up one column. Simply copy paste that block over the empty items at the position of interest (you will need to count it out unfortunately as there are no identifiers).
Bonus Tip: If you make a mistake or want to change something later, you can do a replace on all expressions at once (optional regex allowed).
Remember to backup or check in your work first because the designer may not open that report again correctly if you make a mistake :-)
Select the columns you want to conditionally hide and press F4 to see the Properties Window. Look for the Visibility node and use the Hidden property to set the conditionally expression.
The expression should evaluate to True for hiding and False for showing.
Let me know if this helps.

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.

SSRS tablix Merging cells vertically problem

I found the colspan and rowspan property defined in TablixCell,but in report Designer still can't vertical merge cells,if i modify the RDL xml file manually set Rowspan,the reportViewer show me error info:RowSpan must be 1 for CellContents inside a TablixCell.
is there any other way to implement vertical merge cells of tablix ?
You have to use Matrix instead of Table. I resolved my this problem by creating a matrix same to tablix, below:
Insert a Matrix. Right Click->Insert->Matrix
Change groupable row to detail row. Right click row->Row Group->Group Properties... Then, in tab "General" Choose "group on" belows "add" and "delete" buttons and click delete to remove group ->OK.
Right Click at the first column of Matrix and choose "Delete Column" option. Choose radio button (Delete columns only)->OK
Right click on the first row of Matrix and choose "Insert row" option -> outside group - above and then another row will be added to matrix. After that, delete row that you right click previous.
Now, you can add row above the detail row and can merge any more
If this is only for display purposes, you could try putting a table inside a table. SSRS will let you do this if you delete the grouping columns on the outside table.
Otherwise you are limited to the vertical grouping with Matrices, which still has restrictions on where the vertical merging takes place.
As far as I know, the only way to merge vertically, is to use a Matrix instead of a Table.
http://gotreportviewer.com/matrices/index.html
So my trick is I highlighted the top row of the column I wanted to merge the cells, and changed the border properties to remove the bottom line. When you preview the report, the cells look merged.

group devider in reporting service report

My SSRS report is using groups to divide the data in group. I would like to have a line separator at the last row of the group. I did hide the group footer and header since it gives me an extra row when render the report to excel, So the bordering of group header or footer for this is not working. I wanted to avoid the extra rows in excel. Is there any other way I can try to get this done?
Probably the most powerful thing about Reporting Services is the ability to use expressions for any object property. Couple this with the out-of-the-box Previous function which allows you to access the previous value of a field and you have a solution.
Select the entire Detail row. Expand the BorderStyle property and enter the following code for the Top property (assuming we want a line separating all the departments):
=IIF(Previous(Fields!Department.Value) <> Fields!Department.Value, "Solid", "None")
This compares the previous value of the Department field with the current value and if they are different, it makes the Top border of this detail row to be Solid.
While this puts a line at the top row of next group rather than the bottom row of the previous group, it is visually and functionally equivalent to what you are after with the benefit of being really easy to implement.