Section Trigger Conversion
Classic Dynamics NAV report sections have two triggers - OnPreSection() and OnPostSection(). There are two ways of how code from OnPreSection() and OnPostSection() triggers can be transferred to RDLC format report during conversion. Code can be transferred to new C/AL functions or to RDLC format report layout row visibility in some cases if function CurrReport.SHOWOUTPUT used in section trigger code.
OnPreSection() and OnPostSection() trigger code is transferred to new C/AL functions if:
- Section trigger contains more code than just CurrReport.SHOWOUTPUT function used;
- More than one CurrReport.SHOWOUTPUT used in one section trigger;
- CurrReport.SHOWUTPUT used in both same section triggers (OnPreSection() and OnPostSection());
Symbols :: used
in CurrReport.SHOWUTPUT function. This is frequently used with option type variables (for example,CurrReport.SHOWOUTPUT(„Account Type“ = „Account Type“::Posting)
);- If some C/AL function is used in CurrReport.SHOWOUTPUT function (for example,
GETFILTERS
), except CurrReport.PAGENO;
In other cases OnPreSection() and OnPostSection() triggers code is transferred to RDLC format report layout row visibility.
Example 1. OnPreSection() trigger code conversion to C/AL function.
If on OnPreSection() trigger there is code,
then during conversion there is C/AL global variable and function created (in this case boolean type variable SRB_Integer_Body1_Visible and function Integer_Body1_OnPreSection()).
Code from OnPreSection() trigger is transfered to C/AL function and CurrReport.SHOWOUTPUT function replaced with boolean variable.
There is column with boolean variable as Data Source created in Report Dataset Designer
and used in Report Layout Designer as row visibility expression.
Example 2. OnPreSection() trigger code conversion to layout row visibility expression.
If on OnPreSection() trigger there is code,
then during the conversion there is column with function‘s CurrReport.SHOWOUTPUT parameter as Data Source created in Report Dataset Designer
and used as layout row visibility expression.