Name is Anant Dubey and the intent to create this blog is to discuss the problems and issues that developer face in the dynamics AX development and to share the new things that come up with the new version of AX.
Monday, 14 November 2016
How to create SSRS report using Report data provider (RDP Report) in AX 2012
RDP or Business logic based SSRS Reports in Dynamics Ax 2012 R3.
Logic based report in MS Dynamics Ax 2012 can be develop in following steps
Now consider a scenario, where we have to display list of Item, quantity, Price and total amount sold to customers. It is relatively simple report but have to build this report based on RDP or Report Data Provider framework.
First step to open an Ax client. When Ax client open press Ctrl + shift +W keys to open Dev environment or AOT.
For all artifacts for report development will be a single place and we did not move to node to node in AOT we have to create a AX project.
You can find projects at View=>Projects => Public project.
Create a new project at and rename it with “CustomRDBReport”
Step 1 create a temp table.
The major step in RDP report is decision the fields require in report, create a temp table and add these field in temp table. For current example what fields we required on report are as follow
If we see these fields exists in SalesLine Table. So we drag them into our temp table, and rename them accordingly
Right click on project and create at table with Name “CustomerSalesTemp”,
From property window rename the table as “CustomerSalesTemp” and set TableType to tempDb
Now close all window, open AOT and opens salesLine table. From top menu click on windows => Tile and both tables comes in parallel to each other
and start drag and drop fields in temp table
Now save the table and rename the fields accordingly if required. Also add a new field with Name CustomerName with extended data Type with Name.
Right click compile and synchronize table.
Now create a AOT Query with Name QSalesLine. Add data source on SalesLine and Add following fields on Salesline table
For Date Fileter, we will use ShippingDateConfirmed on Date.
Safe this query.
Step 2 define the report parameters
For current report we required three parameters, Customer, From date and To date.
In Report Data Provider framework which is based on WCF, we have to create a data contract class.
Create a new class in, rename it, CustomerSalesDataContract.
Now open Visual studio and create Model project say “CustomSalesLineReport”.
From solution explorer, create a new report rename it RDPSalesLineReport
Step 5 Bind a report to a report data provider class
Now double click on report and open it in
Add new DataSet and rename it “DSSalesLine”. On right click and from property window set Data Source Type to “Report Data Provider”
And click on Query and from browser window select The data provider class we created in previous step
Click ok to create fields
Now drag and drop data set to Design node in report to create AutoDesign. Rename it “RDPSalesLine”
Expand “RDPSalesLine” design and drag and drop CustAccount field from Data Set to Group and sort nodes
Expand parameter of report and open the property of CustAccount parameter and set its allow blank to true and nullable to true, so if no customer is selected, report will run for all customer in legal entity
Save the report compile it, deploy it and add to AOT
Now switch back to AOT. Create a new menu Item under Display node.
And set menu item Name as “mnuRDPSaleLine” and set its properties as follow
Save it and right click on menu item and open it
Set values for From Date and To date and run the report, Report will work with business logic as follow
Reference taken by:- https://community.dynamics.com/ax/b/alirazatechblog/archive/2015/07/08/rdp-or-business-logic-based-ssrs-reports-in-dynamics-ax-2012-r3