0% found this document useful (0 votes)
73 views10 pages

Develop SSRS Report by Using Report Data Provider - AX SSRS

This document provides steps to develop an SSRS report using a Report Data Provider (RDP) class in Microsoft Dynamics AX. It involves creating a temporary table to store report data, developing an RDP class with business logic to populate the table, and building the report in Visual Studio. The RDP class processes data from AX tables and inserts it into the temporary table. A dataset in the report uses the RDP class to retrieve data and display it. Finally, the report is added to the AX Application Object Tree and deployed to the report server.

Uploaded by

Muhammad Farooq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views10 pages

Develop SSRS Report by Using Report Data Provider - AX SSRS

This document provides steps to develop an SSRS report using a Report Data Provider (RDP) class in Microsoft Dynamics AX. It involves creating a temporary table to store report data, developing an RDP class with business logic to populate the table, and building the report in Visual Studio. The RDP class processes data from AX tables and inserts it into the temporary table. A dataset in the report uses the RDP class to retrieve data and display it. Finally, the report is added to the AX Application Object Tree and deployed to the report server.

Uploaded by

Muhammad Farooq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

11/8/21, 9:27 AM Develop SSRS report by using Report Data Provider | AX SSRS

AX SSRS

Guide for Ax ssrs development

SEP
11
2014

Develop SSRS report by using Report Data Provider

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.

Before going to the development, know about the RDP Class.

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:

Temporary Table Creation:

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.

Go to the development workspace:

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.

The final table should look like the following:

(https://axssrsguide.files.wordpress.com/2014/09/1-vend-tmp-table.jpg)

Report Data Provide Class Creation:

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

Right click Classes Node and select New Class.

Right-click the new class, click Rename, and then enter VendReportSampleDP

 Expand VendReportSampleDP, right-click classDeclaration, and then click View Code.

Paste the following code:

/// <summary>

/// The <c>VendReportSampleDP<c> class declares the variables and tables that are required for the <c>VendRDPReport<c>
report.

/// </summary>

Class VendReportSampleDP extends SrsReportDataProviderbase

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>

///    Fetches the <c>VendSampleTMP</c> temporary table.

/// </summary>

/// <returns>

///    The <c>VendSampleTMP</c> temporary table.

/// </returns>
[

SRSReportDataSetAttribute(tablestr(‘VendSampleTMP’))

public VendSampleTMP getVendSampleTMP()

select * from VendSampleTMP;     

return VendSampleTMP;

Right click the VendReportSampleDP class and select override methods >> processReport

(https://axssrsguide.files.wordpress.com/2014/09/2-processreport.jpg)

And paste the following code:

 /// <summary>

///Fetches the required data for the <c>VendorBalance</c> report.

/// </summary>

public void processReport()

VendTable       vendTable;

VendTrans       vendTrans;

;
while select vendTable

VendSampleTMP.clear();

VendSampleTMP.VendAccount   = vendTable.AccountNum;

VendSampleTMP.VendName      = vendTable.name();

select sum(AmountCur) from vendTrans

where vendTrans.AccountNum == vendTable.AccountNum;

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)

Development of dataset is done for ssrs report.

Now, we will develop a report in Visual Studio.

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)

Now double click the report to open it.

(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.

Let’s see how to add Report to the AOT:

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)

Deploy the report to the Rerport server:

In solution Explorer, right click VendRDPReport and select Deploy

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)

In output window, observe “Deploy succeeded”.

(https://axssrsguide.files.wordpress.com/2014/09/16-deploy-output.jpg)

Go to the AX development environment, AOT>>Menu items>>Output

Right click Output menu item and select New Menu item

And go to the New Menu item properties and change as below

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

Create a free website or blog at WordPress.com.

https://axssrsguide.wordpress.com/2014/09/11/develop-ssrs-report-by-using-report-data-provider/ 10/10

You might also like