21 October 2011

Print ranges on Generated Design of a Report

Business Requirement: printing ranges on a report

Printing the ranges with which a Report has been executed is only available for a AutoDesignSpecs Design of a Report.

Unfortunately this option is not available for Reports having a Generated Design.

Solution: override executeSection method in PageHeader

You can print the ranges with some X++ code modifications in your report.

  1. Add a PageHeader control to the Report, if there isn’t yet such a control in your Report.
  2. Override the executeSection method of the PageHeader control as follows:

    public void executeSection()
    {
    // BGN Printing ranges
    SysReportRun locSysReportRun;
    ;
    //END

    super();

    // BGN Printing ranges
    locSysReportRun = element;
    locSysReportRun.printRanges(true);
    SysReportRun::executePrintRangeSection(element);
    // END
    }


No comments:

Post a Comment