Skip to main content

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 currreport.createtotals

    and function’s CurrReport.CREATETOTLS argument is used in DataItem’s footer section control as a SourceExpr, currreport.createtotals

    during conversion there is text box created with expression: currreport.createtotals

    Here Sales_Invoice_Line_Amount and SRB_Sales_Invoice_Line_Exported are Sales Invoice Line DataItem columns currreport.createtotals

    SRB_Sales_Invoice_Line_Exported is a boolean type variable which gets TRUE value on OnAfterGetReccord() trigger currreport.createtotals

    and its value is changed in C/AL function SRB_DataItemExported() currreport.createtotals

“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 currreport.createtotals

    and function’s CurrReport.CREATETOTLS arguments used in DataItem’s footer section trigger code currreport.createtotals

    after conversion SRB_Total variables are created for CurrReport.CREATETOTLS implementation. currreport.createtotals

    Zero value is assigned to SRB_Total variables on OnPreDataItem() trigger. currreport.createtotals

    Variables are summed with function’s CurrReport.CRATETOTALS arguments on OnAfterGetReccord() trigger. currreport.createtotals

    SRB_Total variables are used in footer section trigger function instead of function’s CurrReport.CREATETOTALS arguments after conversion.
    currreport.createtotals