I am excited to share this new source of data[RDP] for the dataset..We all know in the older version, for a dataset we had only Query and Business logic as a dataset source in SSRS reports. Now in the current version, we have actually 4 options : Query, Business Logic, Report data provider and AX Enum provider.
Today, I will be covering the Report data provider. An RDP class is an X++ class that is used to access and process data for a Reporting Services report. An RDP class is an appropriate data source type when the following conditions are met.
hmmmm.. confused..let me explain with an example. It will be all clear soon 🙂
First things first: The following elements are required to set RDP as your data source type.
step 1: Query
step 2: Temporary table – RDP class fills a temporary table with data that will be used by Reporting Services to display the report.
step 3:Data contract class – To define the parameters in the report.
step 4:Report data provider class – processes business logic based on parameters and a query, and then returns the tables as a dataset for the report. [msdn help]
Let me explain all the steps mentioned above with an example
For step 1: Create a new query by name SR_CustTable and add the dataasource as CustTable as shown below
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.
Step 3: Now we need to Data Contract class – which will help to define parameters in the report.
Create a new class by name "SRSRDPCustTableContractClass" and add a AccountNum global variable as shown below
Add one more parm method to it as shown below
public AccountNum parmAccountNum(AccountNum _accountNum = accountNum)
accountNum = _accountNum;
Done…Lets move to Step 4
Now we need to create Report Data provider class
Create a new class by name "SR_CustTableRDP" that should extend SRSReportDataProviderBase class.
Attach the SRSReportQueryAttribute attribute to specify the query to use to get the data for the report.
For this example, set the attribute to the SR_CustTable query.
Attach the SRSReportParameterAttribute attribute to specify the data contract class that defines the report parameters for the report.
For this example, set the attribute to the SRSRDPCustTableContractClass.
[ SRSReportQueryAttribute (querystr(SR_CustTable)),
class SR_CustTableRDP extends SRSReportDataProviderBase
Now we need 3 more methods to be added
/// Provides the ability to write the report business logic. This method will be called by
/// SSRS at runtime. The method should compute data and populate the data tables that will be
/// returned to SSRS.
public void processReport()
query = this.parmQuery();
srsRDPCustTableContractClass = this.parmDataContract() as SRSRDPCustTableContractClass;
accountNum = srsRDPCustTableContractClass.parmAccountNum();
// Add parameters to the query.
queryBuildDataSource = query.dataSourceTable(tablenum(CustTable));
queryBuildRange = queryBuildDataSource.findRange(fieldnum(CustTable, AccountNum));
queryBuildRange = queryBuildDataSource.addRange(fieldnum(CustTable, AccountNum));
// If an account number has not been set, then use the parameter value to set it.
queryRun = new QueryRun(query);
custTable = queryRun.get(tableNum(CustTable));
/// Table buffer of CustTable table.
private void insertTmpTable(CustTable _custTable)
tmpSR_CustTable.AccountNum = _custTable.AccountNum;
tmpSR_CustTable.Blocked = _custTable.Blocked;
tmpSR_CustTable.PriceGroup = _custTable.PriceGroup;
tmpSR_CustTable.Currency = _custTable.Currency;
public tmpSR_CustTable getTmpSR_CustTable()
select * from tmpSR_CustTable;
wow…we are done with all the steps mentioned above and I am excited to help you guys understand how to use the RDP class as a datasource for the dataset. For this we need to create a new report in the visual studio .
Follow me friends…[I am assuming that all the visual tools have been installed and you have report model template available to created the reports]
Now the next thing what we have to do [the most awaited…] is to create a dataset for this report.
Few more properties for good look and feel of reports : Right click on the Autodesign1 and set the
LayOutTemplate as ReportLayoutStyleTemplate as shown below
Also, since I dont have data in default DAT Company, I would like to use company parameter as well. so I am unhiding the company parameter to select the company parameter along with the Account number [step 3 parameter]
Select the report Tab to view the report. It will take some time to render data.
Here comes the final data on the report – from the RDP class by inserting in to temporary table and showing the same on to report.
hmmmm.. I am done..Hope you understood how RDP classes will help to render the data on to report by using the temporary table concept and Data contract classes. In my last post I have explained how to add this report to the AX menu item.. Follow the same process and check the report by opening from within AX.That’s it for now..