Search This Blog

Friday, March 15, 2013

Pass values from form to Report in Ax2009



1.    Calling menuItem. Task

Form-> MenuButton-> Clicked Method

void clicked()
{
            Args args = new Args();
            MenuFunction menuFunction;
             ;
             args.parm(SalesTable.SalesId);
             menuFunction = new MenuFunction(menuitemoutputstr(Report),
                                                  menuitemType::Output);                                             
                          // Report is menuItem
                        menuFunction.run (args);
                         super ();
                }

Go to Report Init Method

In Report-> init()
Declare the Variable in class Declarations.

public void init()
{

           ItemId  =  element.args().parm();
              ------------------------
             ------------------------------          
           super();
}

Other Way of getting values from form to report…
2.calling report

form->Button
void clicked()
{

Args args = new args();
ReportRun reportRun;
;

args.parm(Table. Field);
args.name(reportstr(Report Name));
reportRun = classFactory.reportRunClass(args);
reportRun.init();
reportrun.run();
========
=======

super ();
}
Report  ‘Override Method –> init’


public void init()
{
;
ItemId  =  element.args().parm();
 ------------------------
 ------------------------------          
super();
}

No comments:

Post a Comment