Call Report to form in axapta

Call Report to form in axapta


 Args args;  
 SysReportRun reportRun;  
 formnm formnm;  
 args = new Args();  
 args.name(reportstr(reportnm));  
 reportRun = classFactory.reportRunClass(args);  
 reportRun.query().interactive(false);  
 reportRun.report().interactive(false);  
 reportRun.setTarget(PrintMedium::Screen);  
 reportRun.run();