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

Selectively hiding detail row if field is blank

5 Answers 783 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 19 Feb 2010, 09:43 PM
I'm using the Q3 2009 version.

I want to selectively hide the detail row in the report when the data source row contains a blank value.

I have tried using the ItemDataBinding event for the detail item, but I am unable to get access to the row in the data table that is being bound to the detail item.

When I look at the ItemtDataBinding event in the debugger I can see the field I need but its contained the ReportItemBase object.

In the debugger, I can see that the sender is an object {Telerik.Reporting.Processing.DetailSection}.

Which inherits from Telerik.Reporting.Processing.ReportSection {Telerik.Reporting.Processing.DetailSection}.

Which inherits from Telerik.Reporting.Processing.ReportSectionBase {Telerik.Reporting.Processing.DetailSection}

Which inherits from Telerik.Reporting.Processing.ReportItemBase {Telerik.Reporting.Processing.DetailSection}.

The ReportItemBase contains the Telerik.Reporting.Processing.IDataObject {Telerik.Reporting.Processing.Data.DataMember} which contains a RawData member which contains the row being bound to the detail item.

I can see that the RawData is a strongly typed row of the data table in my data set.

I thought once I get access to the data row I could check the field for a blank value and hide the detail item by setting the Visible property to false if the field contains a blank.

So, how do I get access to the RawData member of the ReportItemBase object in the ItemDataBinding event?

Thanks for any help on this.

Mark



      

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 22 Feb 2010, 12:42 PM
Hi Mark,

You can see the answer to your question in the Access items from report, calling application and Table help article.
Another possible solution is to handle this through the Conditional Formatting dialog - the Layout pane contains Visible checkbox which when unchecked would hide the item/section if the condition is met.

All the best,
Steve
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Jolanta
Top achievements
Rank 1
Veteran
answered on 16 Feb 2015, 06:57 PM
Hi, the feature - conditional formating works well, I can display/hide a row in my Table.
However, the made invisible by conditional formating row does not collapse. The row has defined row-high. So, the place for the hidden row remains as a blank in my Table. Do you know a trick, how to make the invisible rows collapsed?
In the table, I have not regular rows with same data kind, but each rows shows different data, so I can't filter out the unwished rows at the DataSource level.
Jola
0
Nasko
Telerik team
answered on 17 Feb 2015, 12:19 PM
Hello Jola,

When trying to hide rows in the Table item based on a field value it is recommended to use Filtering instead of Conditional Formatting. The filtered rows will be hidden and there won't be any blank rows in your table. For more information on how to implement the solution, please refer to the Filtering help article and the How to: Add filtering to Table item and Crosstab item help article.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jolanta
Top achievements
Rank 1
Veteran
answered on 19 Feb 2015, 09:34 AM
Hi Nesco,
you always try to work-around my problems, perhaps that I ask for not-possible things in telerik...:-)
If I could filter out the row, this post were not here...
I have not a regular table, but a kind of table-skeleton, where I put several data. And one row is conditional, (if value of one cell of this row is blank and zero, it should disappear). The conditional formatting works - with feature - visible=false, but the row does not collapse...
If in the row-style - the row height were present, I could collapse it by myself:-)
Jola
0
Nasko
Telerik team
answered on 23 Feb 2015, 02:03 PM
Hello Jola,

The Conditional Formatting styles are being applied to the TextBox items in the table cells. It is important to make a distinction between the TextBox items in a single row and the table row itself.
When you select the table row and hide the TextBox items via conditional formatting, the row itself will still be visible even after the items in it are hidden. Since the row height is not available for modification via conditional formatting styles, it is not suitable to use conditional formatting for hiding table rows.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Mark
Top achievements
Rank 1
Answers by
Steve
Telerik team
Jolanta
Top achievements
Rank 1
Veteran
Nasko
Telerik team
Share this question
or