Microsoft Dynamics AX 2012 Reporting Cookbook
上QQ阅读APP看书,第一时间看更新

Adding ranges to the report

Ranges play a crucial role in reports as they try to limit the amount of data that appears and makes it much more interactive. In this part of the recipe, we will see how we can easily expose a query field as a range in the report.

How to do it...

The following steps will help you add ranges to the report:

  1. Open the PKTReleasedProduct query in AOT.
  2. Drag the field Name Alias to the Range node in AOT.
  3. In the Visual Studio project right-click on Datasets and click on Refresh.
  4. The parameter Products_DynamicParameter collectively represents any parameters that will be added dynamically through the ranges. This parameter must be set to True to make additional ranges available during runtime. This adds a Select button to the report dialog, which the user can use to specify additional ranges other than what is added:
  5. Right-click on the auto design ReleasedProducts and select Preview. The preview should display the range that was added in the query.

How it works...

The report dialog uses the query service UI builder to translate the ranges and to expose additional ranges through the query.

Dynamic parameter: Dynamic parameter unanimously represents all the parameters that are added at runtime. This adds the Select button to the dialog from where the user can invoke an advanced query filter window, which can be used to add more ranges and sorting. The dynamic parameter is available per dataset and can be enabled or disabled by setting the Dynamic Filter property to true or false.

The Report wizard in AX 2012 still uses the MorphX reports to auto-create reports using the wizard. The auto-report option that is available on every form uses the new AX SSRS report.