Hi Peers,
In AX 20009, we are running report "Project invoice" through code. when we are doing with code getting issue of data over lapping in report.
There is no issue if we are opening same report from project invoice journal form.
Below is the code.
#EInvoicePDFNodes
ReportRun report;
FilePath filePath = EInvoiceParameters_IT::find().PdfInvoice;
FileName fileName;
PrintJobSettings settings;
ProjPrintInvoice printInvoice;
Args args;
Set permissionSet;
;
printInvoice = new ProjPrintInvoice();
args = new Args(ReportStr(projInvoice));
args.caller(printInvoice);
args.record(projInvoiceJour);
report = new ReportRun(args);
filename = filePath+projInvoiceJour.ProjInvoiceId+".pdf";
permissionSet = new Set(Types::Class);
permissionSet.add(new InteropPermission(InteropKind::ClrInterop));
permissionSet.add(new FileIOPermission(projInvoiceJour.ProjInvoiceId+".pdf", "w"));
CodeAccessPermission::assertMultiple(permissionSet);
if (System.IO.File::Exists(fileName))
{
System.IO.File::Delete(projInvoiceJour.ProjInvoiceId+".pdf");
}
CodeAccessPermission::revertAssert();
settings = report.printJobSettings();
settings.setTarget(PrintMedium::File);
settings.preferredTarget(PrintMedium::File);
settings.format(PrintFormat::PDF);
settings.preferredFileFormat(PrintFormat::PDF);
settings.viewerType(ReportOutputUserType::PDFEmbedFonts);
settings.doNotOverwrite(true);
settings.fileName(fileName);
settings.lockDestinationProperties(true);
printInvoice.updatePrinterSettingsPrintInvoice(settings.packPrintJobSettings());
report.unpackPrintJobSettings(settings.packPrintJobSettings());
report.run();
No issue if same report is running from user interface . Project -> Inquiries -> invoice -> Invoice -> show button - choose Origin
Can you please help here is anyone fixed similar issue, find below screenshots for reference.