TOTALSCAUSEDBY Function (Report)

Microsoft Dynamics Nav 2009

Determines which field caused a group total to be calculated. This determines which field changed contents and thereby concluded a group.


FieldNo := TOTALSCAUSEDBY

Type: Integer

The number of the field that caused the group to end and a group total to be calculated.

This function can only be used in group header and group footer sections. It is useful when you have defined several levels of grouping and need to know which of the groups has changed and caused a group total to be calculated.

This function is not supported on client report definition (RDLC) report layouts.

This example shows how to use the TOTALSCAUSEDBY function to design a report where you group records according to the contents of several fields and you do not want to print the group header section when the item number changes. Use the following C/AL code in the OnPreSection Trigger of the section. To view code in section triggers, on the View menu, click Sections, and then on the View menu, click C/AL Code.

This example requires that you create the following variable.

Name Data type Subtype

ItemRec

Record

Item

IF CurrReport.TOTALSCAUSEDBY = ItemRec.FIELDNO("No.") THEN
  CurrReport.SHOWOUTPUT(FALSE); 

Community Additions

ADD
Show: