LeaderBoard

How to: Group and Order Report Parameters by Using Visual Studio [AX 2012]

This topic describes how to use Visual Studio tools for Microsoft Dynamics AX to group and order report parameters on a parameter form for a report. Parameters are used to limit data retrieved from the data source to only the data needed for the report. When you define a report you will see two kinds of parameters as shown in the following illustration:

Model Editor Screenshot with Parameters

The dataset parameters are in the Parameters node under the dataset. Dataset parameters are the parameters that are generated for that dataset. Report parameters are under the Parameters node at the report level. Report parameters are the parameters that the end-user of the report sees when they run the report. Dataset parameters must reference a report parameter.

The following screenshot illustrates the parameter form that displays when you select the internal account statement report in Microsoft Dynamics AX. The Customers parameter group on the form groups the parameters that are related to customer data. You can also change the order that the parameters and parameter groups display in the form.

Internal account statement report parameter form

Managing Report Parameters

The following sections describe how to add parameter groups, and how to change the order of report parameters or parameter groups.

To add parameter groups

  1. In Model Editor, expand the node for the report that you want to work with.
  2. In Model Editor, right-click the Parameters node for the report, point to Add and then click Parameter group. A new parameter group is added in the Parameters node with a name like ParameterGroup1.
  3. In the Properties window, use the properties as needed for your report. The following table describes the properties for a parameter group:

Property

Description

Caption

The caption displayed for the parameter group. The caption of a parameter group is localizable text. It is a best practice to reference a label ID for the caption text.

Layout direction

The layout direction of the parameters in the parameter group. The options areHorizontal or Vertical.

Name

The name of the parameter group.

  1. Drag report parameters from the Parameters node onto the parameter group. The parameter now displays under the parameter group node.

Note:

If you have a dataset parameter in your report that references the report parameter that you moved to the parameter group, you must update the dataset parameter reference or you will get an error that the Dataset parameter must reference a valid report parameter. The following steps describe how to update the reference to the report parameter.

a. The default naming convention for a report parameter is [DatasetName]_[DatasetParameterName]. In Model Editor, expand the dataset that contains a reference to the report parameter that you added to the parameter group, and then select the dataset parameter.

b. In the Properties window, select the Report parameter drop-down list and then select the report parameter that you added to the parameter group.

  1. Right-click the report design and click Preview to see your changes.

To change the order of report parameters or parameter groups

  1. In Model Editor, expand the node for the report that you want to work with
  2. In Model Editor, expand the Parameters node for the report.
  3. Right-click a parameter or parameter group, and then select a direction to move the element. The options to order parameters or parameter groups are Move to Top, Move Up, Move Down,Move to Bottom, Sort Ascending, and Sort Descending.
  4. Right-click the report design and click Preview to see your changes.

No comments:

Post a Comment