Skip to main content

D365 F&O Report – Using Report data provider(RDP)

This blog post is about how to create a report using Report data provider.
The objects that we will be creating are
  1. Data contract class  - For parameters of the report
  2. Temporary table      - For storing the records to be displayed in the report
  3. Data provider class - For processing the business logic of the report
  4. Action Menu Item    - For front end  display
  5. Report                        - As the name suggests, the report  that will be used.
The sample report that i will be creating is a customer details report. I will be using 'Customer Account Number' as a parameter. A single customer detail will be displayed in the report.
  • First we will create a Data Contract(DC) class
TestCustContractCls
DC_Class_new
I have implemented SysOperationValidatable class so that we can validate the input parameters. You can implement your logic in validate method as shown above.
  •  Create a Temporary table for storing data. Set the Table property to 'InMemory' so that its a tempTable.
TestReportTmpTable
  • Table property
Add the fields that you want to display.
Table fields
  • Create a Data Provider(DP) class to handle the business logic.
TestCustReportDPCls
This class should extend SRSReportDataProviderBase class. The parameter attribute/Query attribute or both should be linked to the DP class. In my case i am using DC class as a parameter, hence SRSReportParameterAttribute is TestCustContractCls.
DP_declaration
We need  to create a method which has SRSReportDataSetAttribute attribute which will return data in the TempTable to the reporting services.
DP_TmpTableDec
The business logic is handle in the doProcess method. In this method, we will insert the records into the temporary table.
Process_Cls
  • A new report 'TestReport' is created.
Go to Report > DataSets > Create a new DataSet >  Properties > Data source type > Report data provider.
Click on Query > Select the DP class you created. In my case it is 'TestCustReportDPCls'.
Report_DataSet
Report_DataSet_Properties

Report_DataSet_choose
Choose all the fields you want in the report.
Create a design for your report. For the sake of simplicity, i have used a auto design over precision design.
Right click on Design > Auto design > Drag and drop the dataSource customer onto it.
  • Create a Output menu item for displaying the report.
TestReportMenuItem
Set the ObjectType property to 'SSRSReport' and Object to 'TestReport'.
Menu_Item_Property
Add the menu Item to a menu bar.
Save > Deploy  the report> build the solution.

Comments