Report Method Sequence (MorphX Reporting Tools)

Important

This content is archived and is not being updated. For the latest documentation, see Microsoft Dynamics 365 product documentation. For the latest release plans, see Dynamics 365 and Microsoft Power Platform release plans.

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

When you open a report, the following methods are called in the order that they appear in the table.

Method

Description

init

Initializes the report and its objects. This is the earliest method that can be overridden among those executed when a report is constructed and run.

Override this method to add initialization tasks, such as the following:

  • Validation of the argument objects received

  • Initialization of supporting classes

  • Dynamic changes to the design

If your changes require access to the objects of the report, add your code after the super() call.

Warning

Do not delete the super() call from this method. The super() call initializes all the objects of the report.

run

Runs the report. This method is executed when the user clicks OK on the preliminary specification dialog box of the report (which enables the user to select where to send the report, and so on).

The default version of this method does the following in the sequence shown:

  1. Calls prompt.

  2. Creates a basic design if it does not already exist.

  3. Arranges the fields.

  4. Calls fetch.

  5. Calls print.

prompt

Prompts the user to select a print medium and other information.

Available mediums include paper, the screen, a print archive, .rtf, HTML, ASCII, .pdf, and text (UTF-8).

To disable the print medium selection, override the method, and then remove the call to super().

Warning

Do not mistake this method for the method of the same name on a query.

fetch

Fetches records from the database. The fetch method instantiates a query, opens the query prompt, and then fetches the records.

During the execution of the fetch method, the next and get methods are executed in pairs on the query of the report. The send, the header and/or footer methods, and the progressInfo method are then executed. The cycle continues with calls to next, get, and so on, until all the data has been fetched.

The following are reasons for overriding the fetch method:

  • The report is not based on a query.

  • Some of the fetched data must be processed (this can also be done on the send method).

  • The report is based on a temporary table.

For more information, see How to: Override the fetch Method to Filter Data for Reports (MorphX Reporting Tools).

print

Prints the report to the selected print medium, such as a printer, file, or screen.

See also

Report Methods (MorphX Reporting Tools)