dimanche 1 mai 2011

How to pass parameters from form to report

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");
     }

}

Happy Daxing!

Aucun commentaire:

Enregistrer un commentaire