
step 2: Temporary table – RDP class fills a temporary table with data that will be used by Reporting Services to display the report.
[msdn help]
step 3:Data contract class – To define the parameters in the report.
For step 1: Create a new query by name DNSalesInvoiceQry and add the datasource as
{
SalesId salesId;
}
Add one more parm method to it as shown below
DataMemberAttribute(“SalesId”)
]
public SalesId parmSalesId(SalesId _SalesId = salesId)
{
SalesId = _SalesId;
return salesId;
}
DP class follows..
/// Declares variables and tables for the <c>AssetBookCompare</c> report.
/// </summary>
[
SRSReportQueryAttribute(querystr(DNSalesInvoiceQry)),
SRSReportParameterAttribute(classstr(DNSalesInvoiceContract))
]
public class DNSalesInvoiceDP extends SRSReportDataProviderBase
{
DNSalesInvoiceTmp DNSalesInvoiceTmp;
SalesId SalesId;
}
_____________________________
private Query buildQuery( Query _query,
SalesId _SalesId)
{
if(_SalesId)
_query.dataSourceTable(tablenum(SalesTable),1).addRange(fieldnum(SalesTable, SalesId)).value(_SalesId);
return _query;
}
____________________
private void getReportParameters()
{
DNSalesInvoiceContract SalesInvoiceContract = this.parmDataContract();
SalesId = SalesInvoiceContract.parmSalesId();
}
_________________________
// <summary>
/// Executes temporary table.
/// </summary>
/// <returns>
/// The temporary table <c>LedgerJournalTmp</c>.
/// </returns>
[
SrsReportDataSetAttribute(tablestr(DNSalesInvoiceTmp))
]
public DNSalesInvoiceTmp getTempData()
{
select DNSalesInvoiceTmp;
return DNSalesInvoiceTmp;
}
___________________________
private void insertTempData(SalesTable _SalesTable,SalesLine _SalesLine,CustInvoiceJour _CustInvoiceJour)
{
SalesLine SalesLineloc;
int m;
DNSalesInvoiceTmp.SalesId = _SalesTable.SalesId;
DNSalesInvoiceTmp.CustAccount = _SalesTable.CustAccount;
DNSalesInvoiceTmp.InventLocationId = _SalesTable.InventLocationId;
DNSalesInvoiceTmp.SalesOrderDate = _SalesTable.createDate();
DNSalesInvoiceTmp.CurrencyCode = _SalesTable.CurrencyCode;
DNSalesInvoiceTmp.WorkerSalesResponsible = _SalesTable.WorkerSalesResponsible;
DNSalesInvoiceTmp.InvoiceDate = _CustInvoiceJour.InvoiceDate;
DNSalesInvoiceTmp.InvoiceId = _CustInvoiceJour.InvoiceId;
DNSalesInvoiceTmp.ItemId = _SalesLine.ItemId;
DNSalesInvoiceTmp.SalesQty = _SalesLine.SalesQty;
DNSalesInvoiceTmp.SalesPrice = _SalesLine.SalesPrice;
DNSalesInvoiceTmp.LineAmount = _SalesLine.LineAmount;
DNSalesInvoiceTmp.Logo = Companyimage::findByRecord(CompanyInfo::find()).Image;
DNSalesInvoiceTmp.Warehouse = InventLocation::find(DNSalesInvoiceTmp.InventLocationId).Name;
DNSalesInvoiceTmp.SalesResponsibleID = Hcmworker::find(DNSalesInvoiceTmp.WorkerSalesResponsible).PersonnelNumber;
DNSalesInvoiceTmp.SalesResponsibleName = Hcmworker::find(DNSalesInvoiceTmp.WorkerSalesResponsible).name();
DNSalesInvoiceTmp.ItemName = InventTable::find(DNSalesInvoiceTmp.ItemId).itemName();
DNSalesInvoiceTmp.CustName = CustTable::find(DNSalesInvoiceTmp.CustAccount).name();
DNSalesInvoiceTmp.CustAddress = CustTable::find(DNSalesInvoiceTmp.CustAccount).address();
DNSalesInvoiceTmp.AddressCity = Dirparty::primaryPOstalAddress(CustTable::find(DNSalesInvoiceTmp.CustAccount)
.Party).City;
select sum(LineAmount) from SalesLineloc where SalesLineloc.SalesId == _SalesTable.SalesId;
m = strLen(numeralsToTxt_in(SalesLineloc.LineAmount));
//strDel(numeralsToTxt_in(_SalesLine.LineAmount), m -5, m) +” “+ CompanyInfo::standardCurrency();
DNSalesInvoiceTmp.StrLineAmount = strDel(numeralsToTxt_in(SalesLineloc.LineAmount), m -5, m) +” ” + CompanyInfo::standardCurrency();
DNSalesInvoiceTmp.insert();
}
__________________________________________________________________
[
SysEntryPointAttribute(false)
]
public void processReport()
{
SalesTable SalesTable;
SalesLine SalesLine;
CustInvoiceJour CustInvoiceJour;
DNSalesInvoiceContract contract;
QueryRun queryRun;
this.getReportParameters();
queryRun = new QueryRun(this.buildQuery(this.parmQuery(),SalesId));
while (queryRun.next())
{
SalesTable = queryRun.get(tableNum(SalesTable)) as SalesTable;
SalesLine = queryRun.get(tableNum(SalesLine))as SalesLine;
CustInvoiceJour = queryRun.get(tableNum(CustInvoiceJour))as CustInvoiceJour;
this.insertTempData(SalesTable, SalesLine, CustInvoiceJour);
}
}
Open visual studio. Click on File >> New project and follow the below process.
Rename the report to “SR_CustTableRDPReport” as shown below by going to the properties of the report

Now the next thing what we have to do [the most awaited…] is to create a dataset for this report.

Go to its properties and rename it to “CustomerDataSet”
Now the real trick, we have a datasource type property on the dataset properties. Select report data
provider as the datasource type as show below.

Select the query property and Click on the ellipsis (…) button to selct the RDP class which you have created in the step 4 as shown below
This will come up with all the RDP classes available in AX. Select SR_CustTableRDP Class and click on next button to select the fields from the tmpTable to shown it on the report.

wonderful..we are done with dataset..Only few steps now..Now we need to create design. Drag and drop this CustomerDataSet to Designs node. It will automatically create the Autodesign1 as shown below
Few more properties for good look and feel of reports : Right click on the Autodesign1 and set the
LayOutTemplate as ReportLayoutStyleTemplate as shown below

Thats it..Now let us run this report.
2 Responses
Thats a detailed explanation..Nice one
etl testing online course
web methods online course
business analyst training
oracle adf training
oracle rac training