Skip to main content

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:

  1. Section trigger contains more code than just CurrReport.SHOWOUTPUT function used;
  2. More than one CurrReport.SHOWOUTPUT used in one section trigger;
  3. CurrReport.SHOWUTPUT used in both same section triggers (OnPreSection() and OnPostSection());
  4. Symbols :: used in CurrReport.SHOWUTPUT function. This is frequently used with option type variables (for example, CurrReport.SHOWOUTPUT(„Account Type“ = „Account Type“::Posting));
  5. 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, section-conversion

    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()). section-conversion section-conversion

    Code from OnPreSection() trigger is transfered to C/AL function and CurrReport.SHOWOUTPUT function replaced with boolean variable.
    section-conversion

    There is column with boolean variable as Data Source created in Report Dataset Designer section-conversion

    and used in Report Layout Designer as row visibility expression. section-conversion

  • Example 2. OnPreSection() trigger code conversion to layout row visibility expression.

    If on OnPreSection() trigger there is code,
    section-conversion

    then during the conversion there is column with function‘s CurrReport.SHOWOUTPUT parameter as Data Source created in Report Dataset Designer section-conversion

    and used as layout row visibility expression.
    section-conversion