Now, we want to create a report for our extension that prints the list of Customer Categories, and for every category, the number of associated customers.
To create a report in AL, we need to go to the Src\CustomerCategory\report
folder and create a new .al
file called Rpt50100-CustomerCategoryList.al
. In this file, we use the treport
snippet to create the report structure:
We need to define the report dataset by defining the data item and the associated fields.
In the report definition, we set two properties (RDLCLayout
and WordLayout
) that define the folders where the RDLC and word layout for this report are defined (here we have created a Layout
folder under our project):
In the OnAfterGetRecord
trigger of the report's data item, we calculate the FlowField
returning the number of customers associated with the current category. Our report definition is as follows:
report 50100 CustomerCategoryList { //DefaultLayout = Word; RDLCLayout = 'Layout...