How to: Define a Report Dataset (Visual Studio Reporting Tools for Microsoft Dynamics AX)

Dynamics AX 2009

A report dataset identifies data that is displayed in a report. You can use a query, stored procedure, or a data method to retrieve data. The following procedure explains how to define a dataset.

NoteNote

If you plan to use a data source other than the predefined Dynamics AX data source, you must first define the data source in Model Editor before defining the dataset. For more information, see How to: Define a Report Data Source (Visual Studio Reporting Tools for Microsoft Dynamics AX).


To define a dataset

  1. In Model Editor, expand the node for the report that you want to work with.

  2. Right-click the Datasets node, and then click Add Dataset.

  3. Select the node for the dataset.

  4. In the Properties window, set the following properties.

    Property

    Description

    Data Source

    The data source for the dataset.

    Data Source Type

    The means of retrieving data from the data source. The options that display in the drop-down menu depend upon what you specify for the Data Source property. For example, if you select Dynamics AX for the Data Source property, you are able to select Query to use a query defined in the AOT or Business Logic to use a data method defined in a reporting project. For more information, see Report Data Overview (Visual Studio Reporting Tools for Microsoft Dynamics AX).

    Default Layout

    The default data region type for the dataset. Specify a value for this property if you plan to use the dataset in an auto design report. For more information about data region types, see Report Data Region Overview (Visual Studio Reporting Tools for Microsoft Dynamics AX).

    Name

    The name of the dataset.

    Query

    The query, stored procedure, or data method that is used to retrieve the data for the dataset.

    • If the Data Source Type property is set to Query, do one of the following:

      • If you are using the predefined Dynamics AX data source, click the ellipsis button (...) to open the Select an AX Query dialog box where you can select a query that is defined in the AOT. In this dialog box, you can also select which fields are to be returned by the query.

      • If you are using a data source other than the predefined Dynamics AX data source, click the ellipsis button. If your data source is a SQL data source, the SQL query builder displays where you can build a TSQL query string. If it is an OLAP data source, the OLAP query builder displays where you can build an MDX query string.

    • If the Data Source Type property is set to Stored Procedure, click the ellipsis button to open a dialog box where you can select a stored procedure.

    • If the Data Source Type property is set to Business Logic, type the name of the data method or click the ellipsis button to display the Select a Data Method window. Only data methods that have a return value of System.Data.DataTable can be used when defining a dataset. Data methods that do not return a System.Data.DataTable will not display in the window. If the data method that you select has parameters and you have not yet specified values for the parameters, you will be prompted to enter values for the parameters. For more information, see Data Method Selector (Visual Studio Reporting Tools for Microsoft Dynamics AX).

    NoteNote

    If your report uses the predefined Dynamics AX data source and a query that is defined in the AOT in Microsoft Dynamics AX, you must be especially careful when updating the query in the AOT. For example, if you remove a field in the query and the field displays in the report, the report will display an empty column for the field. Whenever you make updates to a query, be sure to consider how those updates may affect your reports. Updates to a query may also require updates to your reports.


    After you define a dataset, you can reference the dataset when setting the Dataset property for a data region in an auto design. Alternatively, in Model Editor, you can drag the dataset onto the Designs node. This will create an auto design for the report displaying the data for the dataset. For more information, see How to: Create an Auto Design for a Report (Visual Studio Reporting Tools for Microsoft Dynamics AX).

    If you plan to create a precision design report, the dataset will be available in the DataSets window for SQL Report Designer. For more information, see How to: Create a Precision Design for a Report (Visual Studio Reporting Tools for Microsoft Dynamics AX).

Community Additions

ADD
Show: