In the last post I showed how to print the sales invoice as a pdf. In this post we will do the same but generate a byte array of the pdf report. I tried to make the code as readable as possible and hopefully can use it on other reports.. public static str printSalesInvoiceBase64Str(SalesInvoiceId _salesInvoiceId) { str ret; CustInvoiceJour custInvoiceJour; select firstonly custInvoiceJour where custInvoiceJour.InvoiceId == _salesInvoiceId; if (custInvoiceJour) { str ext = SRSPrintDestinationSettings::findFileNameType(SRSReportFileFormat::PDF, SRSImageFileFormat::BMP); PrintMgmtReportFormatName printMgmtReportFormatName = PrintMgmtDocType::construct(PrintMgmtDocumentType::SalesOrderInvoice).getDefaultReportFormat(); SalesInvoiceContract salesInvoi...
All things Microsoft Dynamics 365 Finance and Operations