Have you ever wanted to generate and view a Business Central report as PDF in an external application, such as an app, website, or other system? In this blog, we explore how this technique can be practically applied to benefit your business and explain how it works.
Why use BC reports in external applications?
By generating and using Business Central reports in external applications, customers and partners can easily view information from Business Central without needing direct access to the Business Central environment. Additionally, external systems can apply parameters to specify the desired content within the report or indicate the type of report needed in the first place.
How it works
To display a Business Central report in an external system, a call must first be made to a Power Automate flow that acts as an API (Application Programming Interface). This flow contains logic to send a request to a Business Central (codeunit) Web Service and also handles the OAuth2.0 authentication. The codeunit generates the report and, if successful, returns it to the flow as a base64 string. The flow then passes it back to the external system, which is responsible for converting the base64 into PDF format.
Best Practices
Safety always comes first, and this is no exception. It is recommended to use BC reports externally only with data that is not sensitive in nature, especially when the external system does not meet the same level of security as Business Central.
Conclusion
Business Central reports can be made available as PDFs in external applications through a Power Automate flow, providing clients and partners with insights without direct access to the Business Central system. This integration enhances the flexibility and applicability of data, provided that the security of shared information is handled carefully.
Sources:
Follow us