New to Telerik Reporting? Download free 30-day trial

How to show more/less details in a Report

Environment

Product Progress® Telerik® Reporting

Description

The article describes an approach for showing only a limited number (e.g. 3) of the details and button 'More...' for optionally showing the rest of the details, or all details and button 'Less...' for optionally hiding part of them.

Solution

Here are the major steps you may follow for each data field that should be displayed in the described way:

  • Set the detail section CanShrink to True
  • Add a TextBox for each data field and set its Visible property with Bindings:

    • Set Property path to 'Visible'
    • Set Value to '= RowNumber()<=3'

    This TextBox (textBox3 in the sample) will display the first 3 values that will always be visible. It will be hidden when the detail section is rendered with the rows after the third.

  • Add a Panel below the TextBox and:

    • Place another TextBox inside (textBox5 in the sample)
    • Let the TextBox occupy the entire Panel
    • Set the Panel CanShrink to True
    • Set the Panel Visible to False
    • Set the TextBox Visible with Bindings as above but with the opposite equation, i.e. '= RowNumber()>3'

    This way the Panel will be initially hidden. When displayed, the Panel will collapse for the first three rows as the TextBox inside it will be invisible. For the rows after the third the Panel will be shown.

  • Add two textboxes in the Group Footer - one with the text 'More..' and the other with the text 'Less..' or as required. Let the 'Less...' TextBox be hidden initially. Add Action Toggle Visibility to both textboxes - the Action should control the above Panel and the two textboxes ('Less...' and 'More...'). With this setting, for example, the 'More...' TextBox will display the Panel and the 'Less...' TextBox and will hide itself, whereas the 'Less...' TextBox will do the opposite.

A sample report demonstrating how to achieve the above can be found here.

In this article