This is a migrated thread and some comments may be shown as answers.

Filter/Hide Group Header if Detail Section has no visible rows

1 Answer 803 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 27 Jul 2016, 09:14 PM

My ObjectDataSource data is flattened as follows (simplified)

Year 1, Item 1, Attribute String {empty}
Year 2, Item 1, Attribute String {empty}
Year 3, Item 1, Attribute String {Some data I want to express as a detail record}

Year 1, Item 2, Attribute String {Some data to display for this detail record}
Year 2, Item 2, Attribute String {empty}
Year 3, Item 2, Attribute String {Some more data to display for this detail record}

Year 1, Item 3, Attribute String {empty}
Year 2, Item 3, Attribute String {empty}
Year 3, Item 3, Attribute String {empty}

I am grouping the data by item name (Item 1, Item 2, Item 3 in this example) and am displaying the item name in the group header. I would like to suppress group headers for items that do not contain any rows with an attribute string (similar to Item 3 in this example.)

I am able to suppress detail rows with empty attribute strings using conditional formatting Field.[Attribute String] = {blank}, Visibility = false.

However, I have not discovered how to suppress the group header.  Filtering the group header on Field.[Attribute String] <> {blank}, seems to only test the first detail row (returning only Item 2 in this example.)

Can anyone think of a way to suppress the group header for only Item 3 for the example data above?

Thanks in advance for any assistance you can offer.

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 29 Jul 2016, 12:09 PM
Hello Jeff,

We can suggest you the following approaches:
  1. Use conditional formatting for the group's Header and Footer sections, where the Filter must be based on an aggregate function as the group's data scope may contain more than one data record.
  2. Use filter in the group's Filters collection based again on an aggregate function. The filter will determine whether the whole group should be visible or not. Filters can be added by selecting the report and checking its groups' properties in the Group Explorer.


Both approaches are illustrated in the attached video. It is a SWF file that can be previewed in IE browser.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Jeff
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or