CurrReport.CREATETOTALS
There are two main ways of how CurrReport.CREATETOTALS function is implemented during the conversion. Function’s CurrReport.CREATETOTALS arguments are used with function Sum() in layout expressions or SRB_Total variables are created for the implementation.
Sum() function in layout expressions
Function’s CurrReport.CREATETOTALS arguments are used with Sum() function in footer/groupfooter rows after conversion if there is no code with function’s CurrReport.CREATETOTALS arguments used in footer/groupfooter sections triggers or arguments used only in CurrReport.SHOWOUTPUT function. After conversion function’s CurrReport.CREATETOTALS arguments are used with scope parameter and few other functions, for example, instead of functions CurrReport.CREATETOTALS argument Amount used in SourceExpr property, after conversion there is layout text box created with expression - Sum(CDbl(IIF(DataItem_Exported,Amount_DataSet_Name,0)))
, here:
Sum – function which returns sum of all specified values, evaluated in the given scope;
CDbl – function which converts an expression to type double;
DataItem_Exported – variable which returns TRUE
if record, which belongs to particular DataItem is processed;
Amount_DataSet_Name – name of Report Dataset Designer column with Amount value in Data Source.
Example. Conversion of footer text box which SourceExpr value is used in CurrReport.CREATETOTALS function.
If there is function CurrReport.CREATETOTALS used in some DataItem’s OnPreDataItem() trigger
and function’s CurrReport.CREATETOTLS argument is used in DataItem’s footer section control as a SourceExpr,
during conversion there is text box created with expression:
Here
Sales_Invoice_Line_Amount
andSRB_Sales_Invoice_Line_Exported
are Sales Invoice Line DataItem columnsSRB_Sales_Invoice_Line_Exported
is a boolean type variable which getsTRUE
value on OnAfterGetReccord() triggerand its value is changed in C/AL function SRB_DataItemExported()
“SRB_Total” C/AL global variables
If there are some code (not only function CurrReport.SHOWOUTPUT used one time) in some footer section trigger with function’s CurrReport.CREATETOTALS arguments used, there are SRB_Total C/AL global variables created to implement function’s CurrReport.CREATETOTALS functionality after conversion. Zero values are assigned for SRB_Total variables in OnPreDataItem() trigger, they are summed with function’s CurrReport.CRATETOTALS arguments on OnAfterGetReccord() trigger and used in footer section trigger code instead of function’s CurrReport.CREATETOTALS arguments after conversion.
Example. Conversion of footer section trigger code if function’s CurrReport.CREATETOTALS arguments used.
If there is function CurrReport.CREATETOTALS used in some DataItem’s OnPreDataItem() trigger
and function’s CurrReport.CREATETOTLS arguments used in DataItem’s footer section trigger code
after conversion SRB_Total variables are created for CurrReport.CREATETOTLS implementation.
Zero value is assigned to SRB_Total variables on OnPreDataItem() trigger.
Variables are summed with function’s CurrReport.CRATETOTALS arguments on OnAfterGetReccord() trigger.
SRB_Total variables are used in footer section trigger function instead of function’s CurrReport.CREATETOTALS arguments after conversion.