Hi Sergei,
Thanks for the quick reply.
I have followed the base customer account statement way.
I have extended my controller class with SrsPrintMgmtController.
I have kept runPrintMgmt method and controlled the customers flow in it.
I have unticked that check box now. Thank you for that!
The run print mgmt method is like below,
protected void runPrintMgmt()
{
printMgmtReportRun = PrintMgmtReportRun::construct(PrintMgmtHierarchyType::Sales ,PrintMgmtNodeType::CustTable,PrintMgmtDocumentType::GSGFXGSMemberStatement);
printMgmtReportRun.parmReportRunController(this);
printMgmtReportRun.load(this.parmArgs().record(),this.parmArgs().record(), Global::currentUserLanguage());
var customerList = new Set(Types::Int64);
var customerQueryRun = new QueryRun(query);
while (customerQueryRun.next())
{
try
{
CustTable custTable = customerQueryRun.get(tableNum(CustTable));
if (!customerList.in(custTable.RecId))
{
customerList.add(custTable.RecId);
select firstOnly DocumentType, ReferencedRecId, ReferencedTableId, RecId from printMgmtDocInstance
join RecId, AccountNum from custTable
join PrintJobSettings from PrintMgmtSettings
where printMgmtDocInstance.DocumentType == PrintMgmtDocumentType::GSGFXGSMemberStatement
&& printMgmtDocInstance.ReferencedRecId == custTable.RecId
&& printMgmtDocInstance.ReferencedTableId == tableNum(custTable)
&& printMgmtSettings.ParentId == printMgmtDocInstance.RecId;
if (PrintMgmtSettings.PrintJobSettings)
{
printDestinationSettings = new SRSPrintDestinationSettings(printMgmtSettings.PrintJobSettings);
printDestinationSettings.overwriteFile(true);
printMgmtReportRun.load(custTable,custTable, Global::currentUserLanguage());
}
else
{
printMgmtReportRun.load(this.parmArgs().record(),this.parmArgs().record(), Global::currentUserLanguage());
}
QueryBuildDataSource qbds = SysQuery::findOrCreateDataSource(query,tableNum(CustTable));
QueryBuildRange qbr = SysQuery::findOrCreateRange(qbds,fieldNum(CustTable, AccountNum));
qbr.value(custTable.AccountNum);
if(custTable.RecId)
{
this.outputReports();
}
}
}
catch
{
throw Error('');
}
}
}
Cn you please tell me where i have done the mistake?