Thursday, 19 June 2014

Interactive Sorting in Dynamics NAV 2013 Reports

Visual studio report designer enables reports to be interactive with its end users. We can let the end users sort data on the report and print it as per their choice.

In this post, I would like to explain how to add interactive sorting capability to your reports in Dynamics NAV.

I created a simple and plain customer list report with dataset as shown below in the Dynamics NAV report designer:

Capture1


In the layout designer, I used a table control to display the data in the body section and I used a text box control to show the title of the report in the header:

Capture2

Now, if we save and run this report, we would get a preview as shown in the following image:

Capture3

Here, the report is sorted on Customer No. by default (as it is the primary key of Customer table). Of course we can change the key in customer DataItem or use Tablix properties to sort on different fields/columns.

However, it can be made more user friendly by letting the end users choose, how the report data is sorted.

1. Open the report layout designer, right click on Name column and open Text box properties.

2. Click on Interactive sorting on the left side and enable interactive sorting. You can specify weather you want to sort on detail rows or groups. You also need to specify the Sort by column.

Follow the above 2 steps on other columns to enable interactive sorting on multiple columns.

Capture4

After enabling interactive sorting, the report preview looks as shown below:

Capture5


Regards,
Sathish

No comments:

Post a Comment