Module / report path: Inventory Management → Inquiries and reports → Physical inventory reports → Inventory aging (InventAging SSRS report, data provider class InventAgingDP)
Goal
Add a custom report parameter, Evs_HideZeroLines, to the standard Inventory Aging report. When turned on, lines with an on-hand quantity of 0 should be excluded from the printed output. When off (default), the report should behave exactly like standard.
The parameter itself was added via a class extension on InventAgingContract and works fine on the dialog. The issue is filtering InventAgingTmp (the temp table backing the report dataset) before it renders.
Relevant standard code:
xpp
[SRSReportDataSetAttribute(tableStr(InventAgingTmp))]
public InventAgingTmp getinventoryAgingTmp()
{
InventAgingTmp inventoryAgingTransTmp;
inventoryAgingTransTmp.setConnection(this.parmUserConnection());
select inventoryAgingTransTmp;
return inventoryAgingTransTmp;
}
Attempt 1 — PostHandlerFor on processReport()
xpp
class Evs_InventAging_DPPostHandler
{
[PostHandlerFor(classStr(InventAgingDP), methodStr(InventAgingDP, processReport))]
public static void InventAgingDP_Post_processReport(XppPrePostArgs args)
{
InventAgingDP dp = args.getThis();
InventAgingContract contract = dp.parmDataContract() as InventAgingContract;
if (contract && contract.parmEvs_HideZeroLines())
{
InventAgingTmp tmp = dp.getinventoryAgingTmp();
ttsbegin;
while select forupdate tmp
{
if (tmp.QtyOnHand == 0)
{
tmp.delete();
}
}
ttscommit;
}
}
}
Result: Handler fires, the matching row is found, tmp.delete() executes without error — but the printed report still shows the same "6.00" line, unchanged.
Attempt 2 — ExtensionOf on getinventoryAgingTmp()
xpp
[ExtensionOf(classStr(InventAgingDP))]
final class Evs_InventAgingDP_Extension
{
public InventAgingTmp getinventoryAgingTmp()
{
InventAgingContract contract = this.parmDataContract() as InventAgingContract;
InventAgingTmp inventoryAgingTransTmp = next getinventoryAgingTmp();
if (contract && contract.parmEvs_HideZeroLines())
{
select inventoryAgingTransTmp
where inventoryAgingTransTmp.QtyOnHand != 0;
}
return inventoryAgingTransTmp;
}
}
Result: Debugger doesn't break inside this method at all, and the printed report is unchanged. No errors reported.
This is my first time working on customizing a System report, please help me as nothing I have tried is working or showing any change.
For testing purposes, If you refer to the attached report, I changed my if condition to 6.00 quantity but still no changes showed in the specific data.