I figured out a sligtly different solution that works.
On the Button Clicked method:
void clicked()
{
Args args = new args();
ReportRun reportRun;
;
args.parm(SMAServiceOrderTable.ServiceOrderId);
args.name(reportstr(GAB_ServiceOrder_NO));
reportRun = classFactory.reportRunClass(args);
reportRun.init();
reportrun.run();
super();
}
And then on the init method on the report;
public void init()
{
;
try
{
if(element.args().parm())
{
this.query().dataSourceTable(tablenum(SMAServiceOrderTable))
.addRange(fieldnum(SMAServiceOrderTable,ServiceOrderID)).value(element.args().parm());
this.query().userUpdate(false);
this.query().interactive(false);
super();
}
}
catch(exception::Error)
{
info("Error in init method");
}
}
On the Button Clicked method:
void clicked()
{
Args args = new args();
ReportRun reportRun;
;
args.parm(SMAServiceOrderTable.ServiceOrderId);
args.name(reportstr(GAB_ServiceOrder_NO));
reportRun = classFactory.reportRunClass(args);
reportRun.init();
reportrun.run();
super();
}
And then on the init method on the report;
public void init()
{
;
try
{
if(element.args().parm())
{
this.query().dataSourceTable(tablenum(SMAServiceOrderTable))
.addRange(fieldnum(SMAServiceOrderTable,ServiceOrderID)).value(element.args().parm());
this.query().userUpdate(false);
this.query().interactive(false);
super();
}
}
catch(exception::Error)
{
info("Error in init method");
}
}