Previous page

Next page

Report Designer - Base Code

Summary

If you want to have user-definable sorting in your report, then you should model an existing PayGlobal Standard report. Modelling an existing report will minimise the amount of base code that you will need to write.

In this part of the exercise, you will not make any changes to the base code. To understand what changes you can make, you need to see how the base code works and where it can be found.

Procedure

You are on the View Report Groups | Leave Reports window.

  1. Right-click TTLEAV001 - Annual Leave Accrued Units(ii).
  2. Select Edit Report Definition from the right-click menu.
  3. Click the Calc tab.
  4. You need to be in Module View.
  5. In the main menu, click View and ensure that Module is ticked.
  6. In the Module View section, click Declarations.

    The sorting variables for Declarations are displayed in the var section. There are four sorting variables displayed. They are called global variables, as they only need to be calculated once when the report is first run.

    Base Code

  7. In the Module View section, click Event Handlers.

    In the right-hand section, click procedure ReportOnStartFirstPass. This procedure is set to run first. The code in this procedure is quite complicated and performs the following actions:

    • Groups the data by the sort fields that you select.
    • Makes the groups that you are sorting by visible. For example if three sorts are selected, then group 1-3 headers and footers will be visible and group 4 will be hidden.
    • Formats the lines, row heights, fonts and alignment for each group that you are sorting by.
    • Creates a new page if the New Page check box is ticked in Edit Report Settings.
    • Makes the detail band visible if the Show Detail Band check box is ticked in Edit Report Settings.
    • Populates the memo field in the summary section of the report with the user details.

      Note: If you model a PayGlobal Standard report, then you should not need to edit this procedure.

Previous page

Next page