How to: Hide Nonfiltered Headers

How to: Hide Nonfiltered Headers

If you apply a filter to the data in a report, then there is an additional header row in the report to display the filter. In the Classic client report layout, if the user does not specify a filter, the filter information is not displayed in the report. When you create a client report definition (RDLC) report layout, you must make some modifications so that if no filter is specified, then the filter information is not displayed.

First, in the Classic report layout, you must add a hidden control to the section for the filter variable. You must add this control so that the filter variable is included in the dataset in the RDLC report layout. Next, in the RDLC report layout, you must create a conditional expression that uses the filter variable that you added to the Classic report layout to hide the filter information.

An example of a report with an additional header row to display filter information is report 113, Customer/Item Sales. The following illustration shows the two hidden fields that were added to report 113 for the two filter variables, CustFilter and ItemLedgEntryFilter.

Dd301423.Local_248243364_nav_plat_report113_sections(en-us,NAV.60).png

Before you begin this procedure, you must create a layout suggestion for the report. For more information, see How to: Create a Layout Suggestion.

To hide non-filtered headers

  1. Add a hidden field to the body section of the report for each filter variable. For example, in report 113, Customer/Item Sales, create two hidden fields:

    • A field where SourceExpr is CustFilter.

    • A field where SourceExpr is ItemLedgEntryFilter.

    For more information, see How to: Add and Identify Hidden Fields.

  2. In the Classic client, on the Tools menu, click Object Designer.

  3. In Object Designer, click Report, select the report that you want to modify, and then click Design.

  4. On the View menu, click Layout.

  5. In Microsoft Visual Studio, in the Report.rdlc file, select the row that displays the filter header.

  6. On the View menu, click Properties Window.

  7. In the Properties window, expand the Visibility field. In the Hidden field, select <Expression…> from the drop-down list.

  8. In the Edit Expression window, create a conditional statement. For example, the following are the conditional statements for report 113.

    =IIF(First(Fields!CustFilter.Value) = "",TRUE,FALSE)
    IIF(First(Fields!ItemLedgEntryFilter.Value) = "",TRUE,FALSE)
    
  9. Save and compile the report. For more information, see How to: Integrate Classic Client Report Designer and Visual Studio Report Designer.

See Also

Community Additions

ADD
Show:
© 2016 Microsoft