다음을 통해 공유


Guidance for Choosing the Data Source Type

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 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

When you define a report in Microsoft Dynamics AX you must specify how to access the data for your report. The options for data source type are query, business logic, report data provider, and AX enum provider.

Data Source Types

The following table provides detail on when to use each data source type to access data for your report.

Data source type

Description

Query

Use when data can be accessed using an AX Query. An AX Query is a query that is defined in the AOT.

When you select Query as the data source type for the report you will select a query defined in the AOT.

The only X++ code involved is the code for the display methods in the tables used for the query.

Any code that would be necessary must be accomplished using the Reporting Services functions.

A query to access data has the following advantages:

  • Filtering occurs in SQL which is faster.

  • There are no X++ classes to develop.

Business Logic

Use to access a data source other than Microsoft Dynamics AX. To use a data method as a data source the following must be true:

  • The return value must be an IEnumerable<DataRow> instance.

  • The class and report must have the same name. This means that you can only use a data method for one report.

  • You must build the project.

  • You must add the project to the AOT.

Report Data Provider

Use when the data to be rendered in the report is not available through a query, you need to further process the data at the time the report is run, and the business logic is based on X++. The following is a list of specific cases when you would use a report data provider:

  • You are using a parameter that is entered in the UI in X++ code, and the business logic processing is based on that parameter.

  • Data to be rendered can be accessed by calling X++ business classes.

  • You are using the dynamic filter and want to add more filters at runtime based on UI parameters.

NoteNote
A query should be considered before you use a Report Data Provider class.

AX Enum Provider

Use when the report parameter is an Enum type. These parameters expose Enum types on a report in a friendly drop-down list. You can create a range on a query to expose an enum parameter in the Microsoft Dynamics AX client. However, if you want the report to be run from Enterprise Portal, you must use an AX Enum Provider to define the parameter. For more information, see How to: Use an Enum as a Report Parameter.

See also

Considerations for Creating a Report

Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.