Sunday, June 14, 2015

Toggle Visibility in Report in NAV 2013 R2

"Toggle" is an Interactive Reporting Feature of Visual Studio. It makes Data Analysis quite interesting and easy. We will make a very simple report to demonstrate this Feature.

Scenario - My Client wants a Customer Report which shows its Customers Country Wise

Step 1. Create a Report


Take Customer Table as the DataItem and add columns Customer "No." and "Country/Region Code" in the Dataset Designer. Add some more columns as required as shown in below snapshot.


Save the Report.

Step 2. Design the Report Layout in Visual Studio


> Once the Layout is open add a Table tool from the Toolbox in the Report Layout. Add columns to this Table.


> Now we will add a Parent Group to this Tablix, Grouping By Customer's "Country/Region Code".
  • Remember to check mark 'Add Group Header' and 'Add Group Footer' while adding this Parent Group, (If we do not select both these options NAV gives a compile time error 'The toggle field must be in the same scope as the other fields...'
So, now we have a layout which looks like the one below


> Now Right-Click on the Data row and click on Row Visibility. Set the properties as shown below,


> Set Display to Hide, Check mark and Select Customer's "Country/ Region Code" in "Display can be toggled by..." Drop-Down list.
> Click OK.
> Save and Execute the Report.

The Output will appear like the one below,


Here we have toggled the visibility of Customers in US and Customers who do not have a Country Code. Like wise you can use toggle in your next report.

That's all folks. 
Post your comments & queries I will be very glad to answer them.

Cheers, 
Ishwar Sharma