Monday, 8 June 2015

Simple SSRS Report

Steps to create simple SSRS Report

There are many types of reports in AX 2012
  1. Query Bases Report
  2. RDP Based Report
  3. Enum Based Report
  4. Business Logic (C# Business Logic with the reporting project only)

  • Query Based Report

  1. Create a query in ax by adding data sources and set the required relations on them (as per the requirements) 
  2. Now log on to Visual studio, create a project and add a new Data-set and in the properties     section of the new data set, select the Report type as "QUERY" and select the query which is created before in AX and click next & finish.
  3. After having added the query it is now time to create a design, u can create precision design or you can opt for Auto Design which is easy, you just need to drag and drop the data-set (which you have created above) into design (right click and create a auto design and then drag and drop).
  4. Then Build the project and select Add to AOT option.
  5. Now create a menu item in AX and link the report.
  6. Simple query based report is ready.

  • RDP Based Report


  1. First of all, create a temporary table. Open AOT à Date Dictionary à Tables.
  2. Right Click on Tables and create a new Table called TestTable.
  3. Set the TableType property to InMemory. This will define the table as a temporary table.
  4. Expand the table node and put the required fields into it.
  5. Now create a RDP class. Go to Classes and create a new class called TestRDPDemoDP by right clicking on Classes and selecting New Class. It is a best practice to suffix the RDP class name with DP .
  6. Open the Class declaration by right clicking on it and selecting View code, the class declaration should extend SRSReportDataProviderBase.
  7. Add a new method and name it getTestRDPDemoTmp. This method is mandatory because reporting services uses this method to get the table buffer containing the processed data. The SRSReportDataSetAttribute attribute is used to indicate the temporary table name and also tells the reporting services to use this method to retrieve the processed data.
  8. Add a new method and name it processReport. This method contains the business logic and is called by reporting services to generate data.
  9. Now create a new report. Since the development of a SSRS report is done in Visual studio, we first need to create a new project in Visual studio.
  10. Open Visual studio. Go to File à New à Project.
  11. In the Installed templates section select Microsoft Dynamics AX and then select Report Model in the right pane. Name the project TestRDPBasedDemo and press Ok.
  12. A new project will be created as shown below.
  13. Now add a new report in the project by right clicking on the project TestRDPBasedDemo à Add à Report.
  14. A report will be added to the project with the name Report1. Rename the report TestRDPBasedDemo.
  15. The report is now completed and can be viewed. To preview the report, select the Design node, right click it and select preview.
  16.  Select the Report tab. The report will appear.
  17. o view this report from AX, Add the report to AOT and create an Output menu item and set the appropriate Properties.
Note: Enum based and Business Logic  reports will be discussed later.

No comments:

Post a Comment