I want to attach a report in e-mail. Format of report is PDF. And i use this code for save report with PDF format;
Args args;
reportRun reportRun;
args = new args();
args.name(reportStr("InventTransferShipReport"));
args.caller(this);
args.parm(transferId);
args.parmObject(setRecord);
args.menuItemName(menuitemOutputStr(InventTransferShipReport));
reportRun = new reportRun(args);
reportRun.init();
WinAPI::deleteFile("C:\\Temp\\Test.pdf");
reportRun.printJobSettings().setTarget(PrintMedium::File);
reportRun.printJobSettings().format(PrintFormat::PDF);
reportRun.printJobSettings().fileName("C:\\Temp\\Test.pdf");
reportRun.run();
if(WinAPI::fileExists("C:\\Temp\\Test.pdf"))
{
info("done");
}
else
{
info("error");
}
But when i debugging code i noticed that the process end when reportRun.run(); execute. So why? How can i fixed this issue?