简体   繁体   中英

SSRS Row Visibility - Hide Parent Row on Toggle Visibility

I have an SSRS report, and I wanted to do a few things --

The Expression row right below the term 'Venue' is a header. It has a command =iif(Fields!sub_order.Value <0, TRUE, FALSE)

What that does for us is state that whenever there is a -1 in the sub_order field don't display the header.

在此处输入图片说明

Then we have the logic on the row below it - The code reads: Hide it and make it a toggle if the user clicks the + on the above header.

在此处输入图片说明 在此处输入图片说明

So when the output is generated for our criteria it looks like this.

Without Toggle: 在此处输入图片说明 With Open Toggle: 在此处输入图片说明

A little about the data -- the parent row exists with a sub_order of 0, a lot of data doesn't have parent data so they have a -1 in that field. When the value is -1 the parent row doesn't display. This works.

show 1 - sub_order -1 --- Standalone, no parent/child
show 2 - sub_order -1 --- Standalone, no parent/child
show 3 - sub_order 0 --- Parent Rows
show 4 - sub_order 1 --- Child 1
show 5 - sub_order 2 --- Child 2
show 6 - sub_order -1 --- Standalone, no parent/child

The issue is when there is a parent row the sub_order value is 0, and all the children's values are 1,2, etc.

What we need to say is when there is a parent value with 0 print that in the header row, make that our parent. The children are to remain hidden to start no matter the consequences. When we click on the + to toggle open the parent row, show us rows 1 and 2 (just the children).

Again, the parent is hidden if the value is -1 (so no parents would be printed or no header rows would be printed if they are a standalone row).

In the case of 0 - 2 or so, we want to print the header row, only with the zero value, and print the children in the sub-grouping. However, no matter what i seem to do because of the toggle, the parent row (with zero value) keeps appearing as part of the children sub-data rows.

we want to hide everything in the sub grouping - and when we toggle it open we want to make sure the value where it is 0 still remains hidden. everything else shows. when its not toggled open it should just show the 0 value and all else is hiding.

You can add a filter on your group, leave the visibility as you'd like it, but add a filter under group properties. Right click group properties, go to filters and add don't display where sub_orders field = 0.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM