Microsoft Dynamics NAV Reports
There are many ways to understand the purpose of reports in Microsoft Dynamics NAV. Reports can have different purposes, but the main purpose is to visualize the data/information from the database repository in a structured way. The best example of a report is a list of customers, vendors, or items. It can even be a list of the top 10 customers, or statistical reports for goods sold.
In addition to statistical reports, which provide information about different resources, there is another category of reports called document reports. Document reports are used to communicate with third parties like sales invoices, credit memos, sales quote, and so on.
Reports can also be used in the system for processing purposes or batch events. These reports do not have a particular layout, or might have some level of layout for interaction purpose. These reports are very important for processing purposes, since they help complete the pending process or calculation process, which is crucial for the data that we process. Here, in this section of the chapter, we will focus mainly on the technical aspect of report design.
Report design
In Microsoft Dynamics NAV 2016, the look and feel of reports have been kept the same as in the previous releases, just keeping in mind the comfort level of users. Creating a report in NAV involves two basic steps: first you have to design the data model/ dataset, and the dataset determines the data that is extracted or calculated from the Microsoft Dynamics NAV database tables, which can be used in a report. After the dataset has been designed, you design the visual layout of the report. There are two tools that you can use for the latter process: Visual Studio Report Designer or SQL Server Report Builder. After you design a report, you can make it available to applications that are running on the Microsoft Dynamics NAV Windows client.
The request page
Most of the reports contain a request page. It is the first thing you see when you run a report. Let's take an overview of the request page:
In the preceding screenshot, we can see a request page of the Customer Top 10 List report. It is the place where you can determine how to view the report. You can provide all the options that a user needs to filter out the data for the reports and a default option to make it more user-friendly.
The report viewer
The report viewer is now more interactive and expressive. As you can see in the next screenshot, the inbuilt graph expresses the data more clearly. Like the previous versions, we can make the report interactive, where the user can click and interact with the data. This feature gives the Microsoft Dynamics NAV report a huge boost:
We will learn how to make the report interactive in the following section.
Interactive sorting and visibility toggle
Similar to the previous version of Microsoft Dynamics NAV, we can make the report interactive, and toggle around with the data. Let's create a new report called itemReport
, and use this report for all the interactive features that we are going to discuss. After you create a simple item-table-based report, perform the following steps:
- Open Object Designer, and select the
ItemReport
report. Then choose Design to open it in Report Dataset Designer, as shown in the following screenshot: - In the View menu, choose Layout. The report opens in Visual Studio.
- Select the No Item text box in the first row, first column. Open the shortcut menu, and then choose Text Box Properties.
- In the Text Box Properties window, choose the Interactive Sorting tab.
- Select the Enable interactive sort action for this text box checkbox.
- In the Sort by drop-down list box, select [No_Item] from the list, choose fx to open the expression window, and then verify that the Set expression for: SortExpression textbox contains the value
=Fields!No.Item.Value
. Click on the OK button: - Click on OK to close the Change interactive sort options for this text box window as seen in this screenshot:
- Repeat the same process for the Description field.
Select the Respective option.
- In the File menu, choose Save Report.rdlc, and close Visual Studio.
- Run the report.
- As you can see in the preceding screenshot, the report is now interactive. When you click on the item caption, there is a small icon to shuffle the sort in ascending or descending order. The following screenshot shows the sorted results: