SSRS : RDP class & Debug it

HI,

Below is the sample code for developing RDP class for SSRS reports

[SRSReportQueryAttribute (querystr(HcmWorkerListPage_Perment)), //My Query

SRSReportParameterAttribute(classStr(SrsRDPContractIndemnity))] //class name

1) class IndemnityRDP extends SRSReportDataProviderBase

{

MZK_PayrollIndemnityTmp        tmpPayrollIndemnity;

Mzk_PayrollIndemnityonly       payrollIndemnityonlycls;

}

2)

[SRSReportDataSetAttribute(“MZK_PayrollIndemnityTmp”)] //tmp table

Public MZK_PayrollIndemnityTmp getDate()

{

select * from tmpPayrollIndemnity;

return tmpPayrollIndemnity;

}

3)

[SysEntryPointAttribute(false)]

public void processReport()

{

QueryRun                    queryRun;

Query                       query;

    SrsRdpContractIndemnity  dataContract;

QueryBuildRange             qbrHcmWorker;

QueryBuildRange             qbrJourTrans;

StartDate                   tillDate;

QueryBuildDataSource          qbsHcmworker;

HcmWorker                   getHcmworker;

// Get the query from the runtime using a dynamic query.

query = this.parmQuery();

// Get the parameters passed from runtime.

dataContract    = this.parmDataContract();

tillDate = dataContract.asOfDate();

// Add parameters to the query.

qbsHcmworker = query.dataSourceTable(tablenum(HcmWorker));

if(tillDate)

{

qbrHcmWorker = qbsHcmworker.findRange(fieldnum(HcmWorker, NewHcmEmployeeType));

// If an invent JournalId has not been set, then use the parameter value to set it.

if(!qbrHcmWorker.value())

qbrHcmWorker.value(int2str(any2int(MZK_EmployeeType::Permanent)));

}

// Run the query with modified ranges.

queryRun    = new QueryRun(query);

ttsbegin;

while (queryRun.next())

{

getHcmworker = queryRun.get(tableNum(HcmWorker));

this.insertTmpTable(getHcmworker, tillDate);

}

ttsCommit;

}

4)

private void insertTmpTable(HcmWorker _hcmWorker,

StartDate  _tilldate=today())

{

HcmPayrollLine      hcmPayrollLline;

HcmEmployment       hcmEmployment;

utcDateTime         joinDateTime;

date                joinDate;

 

payrollIndemnityonlycls = new Mzk_PayrollIndemnityonly();

tmpPayrollIndemnity.Worker                  =   _hcmWorker.RecId;

tmpPayrollIndemnity.NewHcmEmployeeType      =   _hcmWorker.NewHcmEmployeeType;

tmpPayrollIndemnity.CitizenshipCountryRegion=   _hcmWorker.Nationality();

tmpPayrollIndemnity.Joindate                =   _hcmWorker.Joindate();

tmpPayrollIndemnity.Tilldate                =   _tilldate;

tmpPayrollIndemnity.Name                    =   _hcmWorker.name();

tmpPayrollIndemnity.Service                 =   (_tilldate – tmpPayrollIndemnity.Joindate)/365;

joinDateTime = DateTimeUtil::applyTimeZoneOffset(    hcmEmployment::findByWorker(_hcmWorker.RecId).ValidFrom, DateTimeUtil::getUserPreferredTimeZone());

joindate = any2date(joinDateTime);

tmpPayrollIndemnity.Indemnity   =   payrollIndemnityonlycls.payrollGeneration(_hcmWorker.RecId,joindate,_tilldate);

tmpPayrollIndemnity.insert();

}

Debug code for RDP:

static void SSRS_RDPclsDEBUG(Args _args)

{

//MachineBreakDownSlipTmp ACWATransferhistoryTmp;

MZK_PayrollIndemnityTmp payrollIndemnityTmp;

IndemnityRDP dataprovider = new IndemnityRDP();

//MachineBreakDownSlip_queryDP dataprovider = new MachineBreakDownSlip_queryDP();

dataProvider.processReport();

payrollIndemnityTmp = dataProvider.getDate();

}

Advertisements

2 thoughts on “SSRS : RDP class & Debug it

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