Use report functions

Completed

When developing a report, in the report triggers and functions, you can access a special variable called CurrReport. The CurrReport variable always points to the current report object and has the following functions:

  • CurrReport.SKIP

    • Use this function to skip the current record of the current data item. If a record is skipped, it is not included in totals and it isn't printed.

    • Skipping a record in a report is much slower than never reading it at all. Therefore, use filters as much as you can.

    • A typical situation where you can use SKIP is to retrieve records from a related table by using values in the current record to form a filter. If the values in the current record already indicate that records from the related table will not be retrieved, you don't have to perform this processing and you can use SKIP to avoid the processing.

  • CurrReport.BREAK - Use this function to skip the rest of the processing of the data item that is currently processing. The report resumes processing the next data item. All indented data items under the data item that caused the break are also skipped.

  • CurrReport.QUIT - This function skips the rest of the report; however, it isn't an error. It is a typical ending for a report. When you use the QUIT function, the report exits without committing changes that were made to the database during implementation. The OnPostReport trigger won't be called.

  • CurrReport.PREVIEW

    • Use this function to determine whether a report is printing in preview mode.

    • If you run a report in preview mode, and the CurrReport.PREVIEW function is called, then the Print and Save As functionality isn't available.

    • This function ensures that any functionality that depends on the CurrReport.PREVIEW function being FALSE is called correctly when doing the actual print. If you run a client report definition (RDLC) report layout in preview mode and don't call the CurrReport.PREVIEW function, then you can print from the Print Preview window.

The Report data type has additional functions that you can use. For more information, see Report Data Type.