Wednesday, April 13, 2016

PASS VALUES FROM FORM TO REPORT IN AX2009

Pass values from form to Report in Ax2009

Pass Values through Menu Buttons to report in Dynamics AX

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

Related Posts Plugin for WordPress, Blogger...