Report Designs (MorphX Reporting Tools) [AX 2012]

The visible design of a report can be created by using the AOT. There are two available modes, the Automatic and Generated modes.

Creating a Report Design


Both modes begin by following the same steps.

NoteNote

Before you create a report design, create a report that has at least one data source. For more information, see Walkthrough: Creating Reports in the AOT (MorphX Reporting Tools).

To create a report design
  1. In the AOT, expand the Reports node, expand the node of the report for which you want to create a design, right-click Designs, and then click New Report Design.

  2. Right-click the new report design, and then click Properties.

  3. On the Properties sheet of the new report design, set the Name property to MyReportDesign and set the Report Template property to the desired report template (optional).

Automatic Mode


The Automatic mode for creating a report design is generally recommended over the generated mode. The following steps show how to create an automatic report design.

To create an automatic report design
  1. Under the MyReportDesign node, right-click the AutoDesignSpecs node, and then click Generate Specs From Query. This creates a Body subnode for each data source that is used in the query of the report.

  2. Under the AutoDesignSpecs node, right-click a body subnode, point to New Control, and then click the option that allows you to select a field from one of the data sources that were used in the query of the report. This opens a new window that contains the available fields from the data source you selected. Drag the fields you want to appear in the report onto the body subnode where you want the field to display.

    or

    Open a new AOT and navigate to the Fields node of one of the data sources that were used in the query of the report. Drag the fields you want to appear in the report onto the body subnode where you want the field to display.

    NoteNote

    Consider under which data source it is appropriate to add fields. If your report has more than one data source and it does not appear as you expect it to look, this may be the issue.

Generated Mode


The following steps show how to create a generated report design.

To create a generated report design
  1. Right-click MyReportDesign and then click Generate Design. This creates a new Generated Design node with PageHeader and Section Group subnodes. The PageHeader node is created by the report template (optional).

  2. Under the Section Group node of one of the data sources that is used in the query for the report, right-click a body subnode, point to New Control, and then click the option that allows you to select a field from one of the data sources that were used in the query of the report. This opens a new window that contains the available fields from the data source you selected. Drag the fields you want to appear in the report onto the body subnode where you want the field to display.

    or

    Open a new AOT and navigate to the Fields node of one of the data sources that were used in the query of the report. Drag the fields you want to appear in the report onto the body subnode where you want the field to display.

    NoteNote

    Consider under which data source it is appropriate to add fields. If your report has more than one data source and it does not appear as you expect it to look, this may be the issue.

Design Mode Comparison


The report appears the same for each design mode.

To view the report
  1. In the AOT, navigate to the report.

  2. Right-click the report and then click Open.

  3. Click OK on the two dialog boxes to accept the default report printing options.

Under the body node, a PageHeader node that you can customize appears when you use the generated mode. This PageHeader node does not appear when you use the automatic mode.

When changes are made to a report template, the changes are reflected in reports that have designs that were created by using the automatic design mode. If a report is created by using the generated design mode, changes to a report template are not reflected in reports automatically.

Using the display Method Modifier

The display method modifier is used to indicate that a method’s return value is to be displayed on a form or a report.
If you want users to edit the value in the control, use an edit method.
Use the display modifier on methods in the following:
  • Table methods
  • Form methods
  • Form data source methods
  • Report methods
  • Report design methods
Write your display methods on a table. You can use the same code in several forms or reports.
display methods are called each time the form is redrawn. They should not contain complex and time-consuming calculations.

Note
display methods can result in unintended information disclosure.
display methods are not activated if they are on a hidden tabbed page.
display methods can be cached. For more information about caching display methods, 


To create a display method, place the display keyword immediately in front of the method’s return type. For example:
display Amount amount()
display methods must have a return type. The return value is typically a calculated value (for example, a sum).
There should no parameters in a display method unless it is on a form data source where you must include the data source as a parameter. For example:
display InventQty accumulated(InventBudgetInvent Budget)

Note
You must use display on a form data source method when the return value is to be shown on a grid control.

To use a display method on a form or report control, the control and the return type of the method must have identical types. For example, if you have a RealEdit control on your form, the display method you are using must return a value of type real.
Add the display method to a form control.
  1. Set the DataSource property for the control to the data source that contains the method.
    If you do not set the DataSource property, the system assumes that the method has been defined on the form.
  2. Set the DataMethod property to the name of the method.
You might also want to set the ExtendedDataType or ArrayIndex properties:
  • If the ExtendedDataType property is set, formatting, Help text, and so on are inherited from the type specified here.
  • If the display method returns an array, set ArrayIndex to 0 to indicate that all array elements are to be shown in the control. If, for example, you set it to 2, only array element number two is shown.
Add a display method to a report control.
  1. Set the Table property for the control to the table that contains the method.
    If you do not set the Table property, the system assumes that the method has been defined on the report—the report design.
  2. Set the DataMethod property to the name of the method.