I created the method in Axapta for the print report. Then I called this method from .Net. The report won’t print. What can be wrong in the code? I tested this method in Axapta and Report is printing. This is the code from Axapta method:
ReportRun report;
Args args = new Args();
MenuFunction ReplenishmentMenu;
PrintJobSettings printJobSettings = new PrintJobSettings();
;
ReplenishmentMenu = new MenuFunction(menuitemoutputstr(ReplenishmentReport),MenuItemType::Output);
args.record(PlanTable::find(‘PL000049’));
args.parmEnumType(enumName2Id(‘NoYes’)); //send this parameter for can disable interactivies of report and query
args.parmEnum(enum2int(NoYes::Yes));
report = ReplenishmentMenu.create(args);
report.init();
report.report().interactive(false);
report.query().interactive(false);
printJobSettings.setTarget(PrintMedium::Printer);
printJobSettings.deviceName(@’\st1\Canon LBP2900’);
printJobSettings.copies(1);
report.printJobSettings(printJobSettings.packPrintJobSettings());
report.printJobSettings();
report.run();