Documente Academic
Documente Profesional
Documente Cultură
In this lab you will use a report data provider (RDP) class with business logic to
process data and then display the outcome of the business logic on a report. An
RDP class is an X++ class that is used to access and process data for a Reporting
Services report.
Scenario
Develop a report to display customer data with parameters for account number,
account statement and whether to include tax.
Challenge Yourself
Use the information that is provided in the scenario to develop the report.
1
Source: Microsoft Dynamics AX 2012 Reporting, Chapter 2
8. In the second AOT, expand the Data Dictionary node, expand the
Extended Data Types node, and drag the following types to the
Fields node in the first AOT window:
o AccountNum
o CustName
o LogisticsAddressing
o CustGroupID
o Phone
o CustInvoiceAccount
o Action Days
o InclTax
9. In the second AOT window, expand the Base Enums node and drag
the CustAccountStatement enumeration to the Fields node of the
first AOT window.
[DataContractAttribute]
public class SrsRDPContractSample
{
AccountNum accountNum;
CustAccountStatement accountStmt;
Boolean inclTax;
}
5. Save the class and close the editor.
[DataMemberAttribute("AccountNum")]
public AccountNum parmAccountNum(AccountNum _accountNum
= accountNum)
{
accountNum = _accountNum;
return accountNum;
}
3. Save the method and close the editor.
4. Right-click SrsRDPContractSample, point to New, and then click
Method.
5. Edit the method so that it contains the following code.
[DataMemberAttribute("CustAccountStatement")]
public CustAccountStatement
parmAccountStmt(CustAccountStatement _accountStmt =
accountStmt)
{
accountStmt = _accountStmt;
return accountStmt;
}
6. Save the method and close the editor.
7. Right-click SrsRDPContractSample, point to New, and then click
Method.
8. Edit the method so that it contains the following code.
[DataMemberAttribute("InclTax")]
public boolean parmInclTax(boolean _inclTax = inclTax)
{
inclTax = _inclTax;
return inclTax;
}
9. Save the method and close the editor.
[SRSReportDataSetAttribute("TmpCust")]
public TmpCustTableSample getTmpCustTable()
{
select * from tmpCust;
return tmpCust;
}
3. Save the method and close the editor.
This setting is for dynamic parameters on the report. Setting the property to
True allows you to filter the report by setting a range on any fields from the data
source table.
6. For the Query property, click the ellipsis button (…). A dialog box
displays where you can select an RDP class that is defined in the
AOT and identify the fields that you want to use. Select the
SrsRDPSampleClass class and click Next. In the Select Fields dialog
box, keep all the check boxes selected, and then click OK.
In Model Editor, select the Customer node and drag it onto the Designs node. An auto design named
AutoDesign1 is created for the report. Based on what you select, the Query property value is updated. In
this case, the query is SELECT * FROM SrsRDPSampleClass.TmpCust.