Report Data Sources
A Data Set (AxReportDataSet) is the object within an SSRS report that defines where data comes from and what fields are available to the report design. Each report contains one or more data sets, and each data set connects to a data source — an AOT query, a Report Data Provider (RDP) class, business logic, or an enum provider.
Data sets are the bridge between the D365 application data and the SSRS rendering engine. They define:
- The data source type and connection (query name, RDP class, etc.).
- The fields available for binding to design elements.
- The parameters that filter or control the data retrieval.
- The default layout used when the data set is dragged onto an Auto Design.
Data Set Structure
Each data set contains three child collections:
Fields (AxReportDataSetField)
Fields represent the columns of data available from the data set. When using query-based data sets, fields are auto-populated from the query's data source columns. When using RDP-based data sets, fields correspond to the columns of the temporary table returned by the RDP class.
Each field carries metadata that controls how data is displayed and aggregated:
- FieldType — whether the field contains data values or serves as a grouping field.
- AggregationFunction — how values should be aggregated (Sum, Count, Avg, etc.) when the field is used in a grouped context.
- GroupingType — for grouping fields, whether the field groups data as a Category or a Series (relevant for charts and matrices).
- Caption — the display label shown in column headers.
- FormatString — a .NET format string controlling how values are rendered (e.g.,
{0:C}for currency,{0:d}for short date).
Parameters (AxReportDataSetParameter)
Data set parameters are the link between report-level parameters and the data retrieval logic. When a report parameter needs to be passed to a query range or an RDP contract property, a data set parameter maps the two.
Each data set parameter has:
- Parameter — the name of the report-level parameter this maps to.
- Alias — an alias for the query parameter.
- DataType — the data type expected by the underlying data source.
- MultiValue — whether the parameter accepts multiple values (e.g., a list of account numbers).
Field Groups (AxReportDataSetFieldGroupBase)
Field groups organise related data set fields into logical groupings. When you drag a field group onto an Auto Design, all fields in the group are added together, maintaining their order and formatting.
Data Source Types in Detail
Query-based Data Sets
The simplest approach. Set DataSourceType to Query and the Query property to an AOT query name. The framework executes the query at runtime and populates the data set fields automatically.
Advantages:
- No X++ code required.
- Dynamic filters supported via
DynamicFiltersproperty. - The user can modify the query at runtime through the SysQuery dialog.
Limitations:
- Cannot perform complex business logic or cross-table calculations.
- All data must be expressible as a single query with joins and ranges.
RDP-based Data Sets
The most common pattern for production reports. Set DataSourceType to ReportDataProvider and the Query property to the RDP class name. The RDP class processes business logic and populates a temporary table, which the report reads as its data source.
Advantages:
- Full X++ business logic available.
- Can perform complex calculations, aggregations, and cross-table lookups.
- Temporary table output is strongly typed and easy to extend.
Limitations:
- Requires X++ development.
- Data is fully materialised in a temp table before rendering begins.
Business Logic Data Sets
An older approach where X++ methods on the report class itself provide data. The DataSourceType is set to BusinessLogic. This pattern is largely superseded by RDP classes and is rarely used in new development.
Enum Provider Data Sets
A specialised data source type (DataSourceType = EnumProvider) that provides the values of a base enum as rows. This is typically used to populate parameter dropdowns or to provide enum-based lookup data for reports.
Dynamic Filters
When DynamicFilters is set to true on a query-based data set, the report dialog includes a query modification section (SysQuery form) that allows users to add, remove, and modify filter criteria at runtime. This is the same query modification dialog used throughout D365 F&O.
Dynamic filters are only applicable to query-based data sets — RDP-based data sets use the data contract parameters instead.
Data Methods (AxReportDataMethod)
Data methods are X++ methods defined at the report level that can be called from report expressions. They provide a way to perform custom formatting, calculations, or lookups that go beyond what SSRS expressions can handle natively.
Each data method has:
- A Name used to reference it from design expressions.
- A ReturnType defining what the method returns.
- Parameters (
AxReportDataMethodParameter) with name and data type.
External Data Sources (AxReportExternalDataSource)
External data sources allow a report to connect to data outside the standard D365 database — for example, an OLAP cube or an external SQL database. The Provider property specifies the connection type (OLAP or SQL), and ConnectionString provides the connection details.
External data sources bypass the D365 security model. Use them only when absolutely necessary and ensure appropriate access controls are in place at the data source level.
Properties
Data Set Properties
| Property | Display Name | Type | Description |
|---|---|---|---|
| Data SetAxReportDataSet | |||
| Name | Name | String | The name of the element. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| Query | Query | String | Specifies the query string for the given data source and data source type. |
| DataSourceType | Data Source Type | DataSourceType | Indicates the data source type for the given data source. Values: DatabaseStoredProcedure (0), Query (1), BusinessLogic (2), ReportDataProvider (3), EnumProvider (4). |
| DefaultLayout | Default Layout | ReportLayout | Indicates the default layout that should be used when performing a layout of this dataset. Values: Table (0), TopDownList (1), HorizontalList (2), Matrix (3), ColumnChart (4), BarChart (5), LineChart (6), PieChart (7), DoughnutChart (8). |
| DynamicFilters | Dynamic Filters | Boolean | Indicates whether the report will make use of the SysQuery Form like functionality. |
| DataSource | Data Source | String | The datasource for the dataset being used. |
| Data Set FieldAxReportDataSetField | |||
| Name | Name | String | The name of the element. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| DataType | Data Type | String | Specifies the data type of this field. (read-only) |
| Caption | Caption | String | Specifies a caption for the field. |
| FormatString | Format String | String | The format string that should be used when formatting data from this field. |
| Alias | Alias | String | The alias of the data column returned by this field. (read-only) |
| FieldType | Field Type | DataSetFieldType | Specifies whether this field is a data field or a grouping field. Values: Data (0), Grouping (1). |
| AggregationFunction | Aggregation Function | AggregationFunction | The aggregate function that should be used to aggregate data within this field. Values: None (0), Count (1), CountDistinct (2), Sum (3), Avg (4), Min (5), Max (6), Var (7), VarP (8), StDev (9), StDevP (10). |
| GroupingType | Grouping Type | GroupingType | If this is a grouping field, specifies whether it is a category or a series grouping. Values: Category (0), Series (1). |
| UserDefined | User Defined | Boolean | Indicates whether this field is user defined. (read-only) |
| DisableAutoCreateInDataRegion | Disable Auto Create In Data Region | Boolean | Indicates whether the field is used to create a DND data region field. |
| DisplayWidth | Display Width | String | The default display width for data from this field. |
| ParentGrouping | Parent Grouping | String | The parent grouping of the dataset field. |
| Data Set ParameterAxReportDataSetParameter | |||
| Name | Name | String | The name of the element. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| Alias | Alias | String | The alias of the query parameter. |
| DataType | Data Type | String | Specifies the data type of this parameter. |
| MultiValue | Multi Value | Boolean | Indicates whether this parameter is a multi-valued parameter. (read-only) |
| Parameter | Parameter | String | Parameter used for the dataset parameter. |
Report Parameter Properties
| Property | Display Name | Type | Description |
|---|---|---|---|
| Parameter BaseAxReportParameterBase | |||
| Name | Name | String | The name of the element. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| ParameterAxReportParameter | |||
| DataType | Data Type | String | Specifies the data type for this parameter. |
| AllowBlank | Allow Blank | Boolean | Indicates whether this parameter value can be blank. |
| Nullable | Nullable | Boolean | Indicates whether this parameter value can be null. |
| PromptString | Prompt String | String | Specifies the prompt string to use for this parameter. |
| MultiValue | Multi Value | Boolean | Indicates whether this parameter can be multi-valued. |
| UserVisibility | Visibility | ParameterVisibility | Indicates whether this parameter is visible, hidden or internal. Values: Visible (0), Hidden (1), Internal (2). |
| AOTQuery | AOT Query | String | Indicates which AOT query to open in the SysQuery Form. |
| Parameter GroupAxReportParameterGroup | |||
| Caption | Caption | String | The caption for the parameter group. |
| LayoutDirection | Layout Direction | LayoutDirection | Layout direction of the parameter group in UI. Values: Vertical (0), Horizontal (1). |
Data Method Properties
| Property | Display Name | Type | Description |
|---|---|---|---|
| Data MethodAxReportDataMethod | |||
| Name | Name | String | The name of the data method. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| ReturnType | Return Type | String | The return type of the data method. |
| Method ParameterAxReportDataMethodParameter | |||
| Name | Name | String | The name of the method parameter. |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| DataType | Data Type | String | The data type of the method parameter. |
External Data Source Properties
| Property | Display Name | Type | Description |
|---|---|---|---|
| External Data SourceAxReportExternalDataSource | |||
| Name | Name | String | The name of the element. |
| IsObsolete | Is Obsolete | NoYes | Determines whether the element is deprecated or not. Values: No (0), Yes (1). |
| Visibility | Visibility | CompilerVisibility | The visibility of the element. Values: Private (0), Protected (1), Public (2), Internal (3), InternalProtected (4). |
| Tags | Tags | String | Tags for this element separated by semicolon. |
| ConnectionString | Connection String | String | Specifies the connection string to use for the data source. |
| Provider | Provider | ExternalDataSourceType | Indicates the provider for this data source. Values: Olap (0), SQL (1). |