A query is the simplest way to fetch data for a report. Queries are beneficial as they are reusable and are easy to design. This recipe will guide you in creating a query in the AOT with the necessary optimization for a report datasource. The later part will guide you through creating a Visual Studio project for report development and use the query created to create a report datasource.
To work through this recipe, AX 2012 or AX 2012 R2 rich client with developer permission is required.
You can use a query as a datasource in the report, as follows: