How to diplay the total of a column in a report in Dynamics AX

1. To diplay the total of a column (named ColumnA), you have to :

Click on ColumnA and open its properties (Alt+enter)

Modify the SumAll to YES
Create a new field (named ColumnASum) typed Sum
In its properties, modify the dataFieldName to ColumnA
That’s all, the sum of all lines will be diplayed in the field.

Remark : naturally the ColumnASum must be created outside and after the Body containing the ColumnA
For example, you put the ColumnA in the body of a section group in a generated design and the sum of this column in the footer of the section group.

II. You can also calculate the sum of a column following another method : In the classdeclaration, declare a variable : sumnet

In the executeSection method of the body you calculate the sum of your column :

public void executeSection()


Then, in the method of your report create a method that displays this variable :

Display Amount _SumNet()
return SumNet;

In the Grand Total section : Footer of the generated design for example:
create a field and set its DataMethod to _SumNet .
this field calculates the sum of your column.