Dynamics 365 Business Central: Set a PDF password for the report (Password protect the document using a user and admin passwords) – No control add-in and APIs
The OnPreRendering report trigger in Business Central 2025 release wave 1 enables developers to add PDF password protection to exported reports using user and admin passwords without requiring control add-ins or APIs. The trigger runs after the report dataset is finalized but before rendering, allowing protection settings to be added to the rendering payload.

post Dynamics 365 Lab
"OnPreRendering (Report) trigger: Runs when a report dataset has been finalized and before the output artifact has been rendered."
Key points
- OnPreRendering trigger available in runtime version 15.0 and Business Central 2025 wave 1
- Add user password to require authentication to open PDF, and optional admin password for full access
- Protection settings are configured by creating a JsonObject and adding it to the RenderingPayload
- Password protection works for both standard report exports and Attach as PDF feature
- No external tools, APIs, or control add-ins needed for basic password protection
Quotes
- “OnPreRendering (Report) trigger: Runs when a report dataset has been finalized and before the output artifact has been rendered.” (Defines the precise timing when developers can add password protection to PDF reports)
- “Password protect the document using a user and admin passwords.” (Clarifies the two-level password protection capability available through the trigger)
- “Notice that if this element is empty, the platform will apply the user password to this field.” (Important behavior to understand when only user password is specified)
AL objects mentioned
As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Composite Layouts in Business Central 29.0: Brand One Report End to End — possibly related: both name Report 1306 “Standard Sales - Invoice”
- Dynamics 365 Business Central: Adding comments to Factbox/Report (Displaying Comments in a FactBox/Report) — possibly related: both name Report 1305 “Standard Sales - Order Conf.”
- Dynamics 365 Business Central: How to run a Report in Preview Mode without the Request Page (Hide Request Page) — possibly related: both name Report 1306 “Standard Sales - Invoice”
- Standard Sales - Order Conf. (report) — possibly related: names Report 1305 “Standard Sales - Order Conf.”
Heads up
- preview-disclaimer: “Available or changed with runtime version 15.0 – Business Central 2025 release wave 1” (about other OnPreRendering (Report) trigger, OnPreRendering, version Business Central 2025 release wave 1)
- gotcha: “Notice that if this element is empty, the platform will apply the user password to this field.” (about other protection\admin)
Context
- Features: PDF password protection, OnPreRendering trigger, User password, Admin password, Report extensions, PDF attachments for electronic invoicing
- Versions: Business Central 2025 release wave 1, Runtime version 15.0
Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.