
Microsoft Dynamics AX 2012 R3 Reporting Cookbook Update
By :

Queries offer the simplest and easiest way to retrieve data for SSRS reports in Dynamics AX R3. They are very advantageous as they are reusable, and the same query can be used as the data source of another SSRS report in Dynamics AX R3. They are also very easy to design.
We can create queries in two ways: either by using the query class, or under the Queries node in Application Object Tree (AOT). In this recipe, we will create a query under the Queries node in AOT and use it as a data source in SSRS reports. Later on, we will guide you on how to add the query as a data source through Visual Studio.
To work through this recipe, you will require AX 2012 R2 or AX 2012 R3 rich clients with developer permission.
Create a new query named PKTVendorDetails
under the Queries node in AOT, and add some fields in the query. Create a new SSRS report in Visual Studio 2010 and add the PKTVendorDetails query into that report as a data source.
PKTVendorDetails
.VendTable
and set property table to VendTable
.VendTable
. You can use any of these:Yes
. This will automatically add all the fields in the VendTable to the query.PKTVendorDetailsReport
.PKTVendorDetailsReport
.VendorMaster
.This will generate the fields list for the dataset. This completes the addition of a dataset to a report.
In this receipe we have used queries as a datasource in SSRS report in Dynamics AX R3 as queries are reusable and can help to add the ranges in a report.
When creating a new report project in Visual Studio, if there is no option such as Microsoft Dynamics AX, then ensure that you have your reporting extensions installed. When you have multiple instances of Dynamics AX installed, Visual Studio identifies the instance to connect to from the client configuration. The active client configuration is used to establish the connection. The layer in which the report must be created is also fetched from the client configuration.
With AX 2012, Windows Communication Foundation (WCF) based system services have been introduced. This includes the metadata service, query service, and user session service. The SSRS reporting extension uses the query and metadata services. The metadata service helps the report designer in Visual Studio to retrieve the metadata information of Queries, Tables, and Extended Data Types (EDT). The query service is used to fetch the data.
In the case of a complex query, a better approach would be validating the query before it is included in the report. Write a job in Dynamics AX that will use the query to retrieve the data and print the values to the infolog. This will help in identifying the problem when there is an issue with the report.
The report supports multiple datasets, but as in AX forms these datasets cannot be joined and they remain independent.
Change the font size
Change margin width
Change background colour