Develop SSRS Report by Using Report Data Provider - AX SSRS
Develop SSRS Report by Using Report Data Provider - AX SSRS
AX SSRS
SEP
11
2014
Hi Everyone,
We have multiple methods to develop SSRS reports in Microsoft Dynamics AX 2012. This post will help you in
developing Report Data Provider (RDP) based SSRS reports.
RDP class is used to access and process data for a report. The options for a data source type for a Microsoft
Dynamics AX report are query, business logic, and RDP. An RDP class is an appropriate data source type when
the following conditions are met.
1. You cannot query directly for the data you want to render on a report.
2. The data to be processed and displayed is from Microsoft Dynamics AX.
The following elements are required to set RDP as your data source type.
Temporary table – RDP class fills a temporary table with data that will be used by Reporting Services to
display the report.
Data contract class – defines the parameters in the report.
Report data provider class – processes business logic based on parameters and a query, and then returns the
tables as a dataset for the report.
Let’s see how to develop simple ssrs report using rdp class:
Data for an RDP report is preprocessed and then stored in a temporary table. The temporary table is used by
Reporting Services when the report is displayed. A table returned by a method can be a temporary table
(InMemory or TempDB) or a regular table. When the data returned is used for reporting only, it is a best
practice to use a temporary table.
Use an InMemory temporary table if the dataset is small, for reports that will display fewer than 1000
records.
Use a TempDB temporary table for large datasets to improve performance.
In AOT >>Tables
Right click Table Node and select New Table,right click the New Table and select Properties.
In New Table Properties, set Name Property as VendSampleTMP and set the Table Type property as TEMP DB
or InMemory.
https://axssrsguide.wordpress.com/2014/09/11/develop-ssrs-report-by-using-report-data-provider/ 1/10
11/8/21, 9:27 AM Develop SSRS report by using Report Data Provider | AX SSRS
(https://axssrsguide.files.wordpress.com/2014/09/0-tmp-table-creation.jpg)
Expand the node next to the VendSampleTMP table so that you can see the Fields node.
Press Ctrl+D to open another AOT window and move the window so you can see both AOT windows.
In the second AOT, expand the Data Dictionary node, expand the Extended Data Types node, and drag the
following types to the Field node in the first AOT window
VendAccount
VendName
Right click Fields node and select Integer change the Name property as VendBalance and Label property as
Balance.
(https://axssrsguide.files.wordpress.com/2014/09/1-vend-tmp-table.jpg)
The RDP class is a data provider that allows you to add business logic for the data that is displayed on a report.
The business logic for this example prompts the end user for parameter values, processes business logic to
generate data in a table, and then returns the table to render in the report. In this section, you define the RDP
class by extending the SRSReportDataProviderBase class.
In AOT >>Classes
/// <summary>
/// The <c>VendReportSampleDP<c> class declares the variables and tables that are required for the <c>VendRDPReport<c>
report.
/// </summary>
https://axssrsguide.wordpress.com/2014/09/11/develop-ssrs-report-by-using-report-data-provider/ 2/10
11/8/21, 9:27 AM Develop SSRS report by using Report Data Provider | AX SSRS
VendSampleTMP VendSampleTMP;
}
Right click the VendReportSampleDP class and select New Method, and paste the following code
/// <summary>
/// </summary>
/// <returns>
/// </returns>
[
SRSReportDataSetAttribute(tablestr(‘VendSampleTMP’))
return VendSampleTMP;
Right click the VendReportSampleDP class and select override methods >> processReport
(https://axssrsguide.files.wordpress.com/2014/09/2-processreport.jpg)
/// <summary>
/// </summary>
VendTable vendTable;
VendTrans vendTrans;
;
while select vendTable
VendSampleTMP.clear();
VendSampleTMP.VendAccount = vendTable.AccountNum;
VendSampleTMP.VendName = vendTable.name();
VendSampleTMP.VendBalance = vendTrans.AmountCur;
VendSampleTMP.insert();
https://axssrsguide.wordpress.com/2014/09/11/develop-ssrs-report-by-using-report-data-provider/ 3/10
11/8/21, 9:27 AM Develop SSRS report by using Report Data Provider | AX SSRS
}
}
The VendReportSampleDP class looks like below:
(https://axssrsguide.files.wordpress.com/2014/09/3-
vendreportsampledp.png)
Open Visual Studio, go to the File Menu >> select New >>Project as shown below
(https://axssrsguide.files.wordpress.com/2014/09/4-new-project.jpg)
In the installed templates section, select Microsoft Dynamics AX and then select Report Model in the right
pane. Name the project VendRDPReport and press Ok. As shown below:
(https://axssrsguide.files.wordpress.com/2014/09/5-project-creation.jpg)
https://axssrsguide.wordpress.com/2014/09/11/develop-ssrs-report-by-using-report-data-provider/ 4/10
11/8/21, 9:27 AM Develop SSRS report by using Report Data Provider | AX SSRS
Go to the Solution Explorer
Right click the VendRDPReport >>select Add >> select Report as shown below
(https://axssrsguide.files.wordpress.com/2014/09/6-new-report-adding-to-the-project.jpg)
(https://axssrsguide.files.wordpress.com/2014/09/7-new-report.jpg)
Right click the Dataset and select Add Dataset and change it’s Name as VendBalanceData
(https://axssrsguide.files.wordpress.com/2014/09/8-
add-dataset.jpg)
Select the Dataset, go to the properties and set the DataSource Type to Report Data Provider. Then select
the Query field. An ellipse button appears. Click it to open a dialog box.
https://axssrsguide.wordpress.com/2014/09/11/develop-ssrs-report-by-using-report-data-provider/ 5/10
11/8/21, 9:27 AM Develop SSRS report by using Report Data Provider | AX SSRS
(https://axssrsguide.files.wordpress.com/2014/09/9-
datasetproperties.jpg)
This dialog box lists all the RDP classes present in the AOT. Select VendReportSampleRDP and press Next.
(https://axssrsguide.files.wordpress.com/2014/09/10-select-dp-calss.jpg)
Select the fields to be displayed in the report and press OK. Only the fields selected in this dialog box can be
shown in the report.
https://axssrsguide.wordpress.com/2014/09/11/develop-ssrs-report-by-using-report-data-provider/ 6/10
11/8/21, 9:27 AM Develop SSRS report by using Report Data Provider | AX SSRS
(https://axssrsguide.files.wordpress.com/2014/09/11-selecting-fields.jpg)
Go to the Design Node and Right click and select Add >> Select Auto Design
(https://axssrsguide.files.wordpress.com/2014/09/12-desinging-report.jpg)
And change the design name as Report . Now drag the VendBalanceData form to the Datasets node and drop it
on the Design node. A table will be created which contain all the fields present in the data set.
https://axssrsguide.wordpress.com/2014/09/11/develop-ssrs-report-by-using-report-data-provider/ 7/10
11/8/21, 9:27 AM Develop SSRS report by using Report Data Provider | AX SSRS
(https://axssrsguide.files.wordpress.com/2014/09/13-fields-add-to-design.jpg)
Now report development is done. We need to add the report to AOT and deploy report to the Report server.
In solution Explorer, right click VendRDPReport and select Add VendRDPReport to AOT
(https://axssrsguide.files.wordpress.com/2014/09/14-report-add-to-aot.png)
https://axssrsguide.wordpress.com/2014/09/11/develop-ssrs-report-by-using-report-data-provider/ 8/10
11/8/21, 9:27 AM Develop SSRS report by using Report Data Provider | AX SSRS
(https://axssrsguide.files.wordpress.com/2014/09/15-report-deploy.jpg)
(https://axssrsguide.files.wordpress.com/2014/09/16-deploy-output.jpg)
Right click Output menu item and select New Menu item
Name : VendRDPReport
ObjectType : SSRSReport
Object : VendReport.
(https://axssrsguide.files.wordpress.com/2014/09/17-menuitem-properties.jpg)
Now time to run the report, right click the VendRDPReport menu item and click open.
Output :
https://axssrsguide.wordpress.com/2014/09/11/develop-ssrs-report-by-using-report-data-provider/ 9/10
11/8/21, 9:27 AM Develop SSRS report by using Report Data Provider | AX SSRS
(https://axssrsguide.files.wordpress.com/2014/09/18-report-output.jpg)
Thank You…
By axssrsguide
• Posted in AX SSRS • Tagged ssrs rdp based report, using rdp ssrs report
https://axssrsguide.wordpress.com/2014/09/11/develop-ssrs-report-by-using-report-data-provider/ 10/10