Totals are an important element of creating useful reports. By totaling data, your report can help the user analyze data that is not otherwise readily available. For example, totals provide a useful overview of the total sales for a given month. Reports can be created with Microsoft Dynamics NAV 2009 and later designed using Visual Studio. This topic describes how to add totals to a report in Visual Studio.
To add totals in Visual Studio
-
In Visual Studio, right-click the total field on the report and select Expression.
-
In the Expression window enter the following expression:
=SUM(Fields!<tablefield>.Value)
For example:=SUM(Fields!Sales_Line_Amount.Value)
-
Save the report in Visual Studio.
-
Compile and save the report in Microsoft Dynamics NAV 2009. A message informs you that the .rdlc file for this report has changed and asks if you want to load the changes. Click Yes to save the changes in the database.