In the world of ERP solutions, the capability to create reports and disseminate them across different systems is of paramount importance. This functionality becomes even more critical within platforms like Microsoft Dynamics 365 Business Central, celebrated for its robust reporting features.
PDFObject is a library that runs the standard built-in PDF renderer in the browser. This means that the rendering in different browsers may be different. This is a very interesting option for displaying PDFs in Business Central, as browser-based PDF Viewers often have powerful functionality.
I saw a question in community yesterday, is there a way to automatically attach a PDF to a posted sales invoice? He wants to save the report before posting in the posted sales invoice.
In fact, BC has standard feature (Attach as PDF…) that can do this, however, it needs to be manually clicked once.
I have prepared a lightweight ready to use free extension for viewing PDF documents in Business Central. I’ve heard requests for Microsoft’s built-in PDF Viewer on more than one occasion. But since Microsoft is still working on this problem, I found it helpful to make a simplified version. This extension doesn’t need any additional servers.
I will show you a simple process that I have automated with the Azure Event Grid and Logic Apps, sending an invoice PDF to my webshop API. Since we have all these events inside Business Central, all we have to do is subscribe to an event in an extension and send it to the Azure Event Grid.
On the Business Central Cloud, to save a report in PDF format and change its name while saving, you can use a STREAM BLOB through the “Temp blob” codeunit.
Once this is done, use the function then the BLOBExport function present in the “File Management” codeunit to export the report created with the “REPORT.SAVEAS” command, changing its name during saving.