Simple RDP Class with Contract Class in AX 2012

Firstly create contract class and specify the field which you want to provide as    parameter in the report.

Use this Contract class in RDP class as parameter.

[DataContractAttribute]
public class FilterDemoContract
{

EmplId emplId;

}

[DataMemberAttribute(“EmplId”)]
public EmplId parmEmplId(EmplId _emplId = emplId)
{

emplId = _emplId;
return emplId;

}

Now Declare Table buffers in the Class declaration of RDP Class including Temp Table Buffer.

[SRSReportParameterAttribute(classstr(FilterDemoContract))]
class ContractDemoClass extends SRSReportDataProviderBase
{

TempFilterDemo tempFilterDemo;
FilterDemo filterDemo;

}

[SRSReportDataSetAttribute(“TempFilterDemo”)]
public TempFilterDemo getTempFIlterDemo()
{

select * from tempFilterDemo;
return tempFilterDemo;

}
public void insertTmpTable()
{

tempFilterDemo.EmplId = filterDemo.EmplId;
tempFilterDemo.Name = filterDemo.Name;
tempFilterDemo.Salary = filterDemo.Salary;
tempFilterDemo.Gender = filterDemo.Gender;
tempFilterDemo.insert();

}

SysEntryPointAttribute(false)]
public void ProcessReport()
{

EmplId emplId;
FilterDemoContract contract;

;

contract = this.parmDataContract() as FilterDemoContract;
emplId = contract.parmEmplId();
select * from filterDemo where filterDemo.EmplId == emplId;
this.insertTmpTable();

}

Now you left with SSRS part, in the report, one Dialog Box will popped up, there, you would enter the emplid value and report will show you that particular record.

Advertisements

2 responses

  1. mr.raziq plz post sequence of this report classes contract,uibuilderclass and rdp

    Like

  2. Shabir Ahmad | Reply

    Great Work

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: