Process Report

///


/// Processes the report business logic. Calls helper methods and inserts data to temporary table.
///

///
/// Provides the ability to write the report business logic. This method will be called by
/// SSRS at runtime. The method should compute data and populate the data tables that will be
/// returned to SSRS.
///
[SysEntryPointAttribute(false)]
public void processReport()
{
TradeDocumentReportContract objContract = this.parmDataContract() as TradeDocumentReportContract;
RecId recId = objContract.parmRecordId();
PurchPackingSlipHeaderTmp localPurchPackingSlipHeaderTmp;
PurchPackingSlipTmp localPurchPackingSlipTmp;
RecordSortedList recordList;
//ptgrn
PurchLineAmount purchLineAmount=0.00;
int amount;
str amountStr;
//ptgrn

localPurchPackingSlipHeaderTmp = PurchPackingSlipHeaderTmp::findJourRecId(recId);

//ptgrn
amount = real2int(purchLineAmount);

if(amount==0)

{
amountStr=int2str(amount);
amountStr=“NILL”;
//info(strFmt("%1",amountStr));
}
//ptgrn

if (localPurchPackingSlipHeaderTmp.RecId)
{ //the report data is already created so use it. this is the proforma scenario.
recordList = new RecordSortedList(tableNum(PurchPackingSlipHeaderTmp));
recordList.sortOrder(fieldNum(PurchPackingSlipHeaderTmp, RecId));
recordList.ins(localPurchPackingSlipHeaderTmp);

localPurchPackingSlipHeaderTmp.delete(); //the created data is copied so it should be deleted.

recordList.insertDatabase(this.parmUserConnection()); //it is inserted within user user connection so the framework will delete it automatically after the report is done.

recordList = new RecordSortedList(tableNum(PurchPackingSlipTmp));
recordList.sortOrder(fieldNum(PurchPackingSlipTmp, RecId));

while select localPurchPackingSlipTmp
where localPurchPackingSlipTmp.JournalRecId == recId
{
recordList.ins(localPurchPackingSlipTmp);
}

delete_from localPurchPackingSlipTmp //the created data is copied so it should be deleted.
where localPurchPackingSlipTmp.JournalRecId == recId;

recordList.insertDatabase(this.parmUserConnection()); //it is inserted within user user connection so the framework will delete it automatically after the report is done.
}
else
{
// Set the userconnection to use on table.
// This is required to ensure that createdTransactionId of inserted record is different than default transaction.
purchPackingSlipHeaderTmp.setConnection(this.parmUserConnection());
purchPackingSlipTmp.setConnection(this.parmUserConnection());
this.createData(objContract);
}
}

And what’s your question?