community postReporting & Analyticscommunity - not Microsoftreviewed - checked by Opus

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

Yun Zhu · 2025-11-25 · 418 words · about 2 min

"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.

No source states these links: they share an object, a model read them, or a person found the same subject.

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.