topic hubAL Developmentofficial - Microsoftreviewed - checked by Opus

Developing printer extensions

Printer extensions in Business Central let AL developers send reports directly to web-connected printers. The section answers questions about the OnAfterSetupPrinters and OnAfterDocumentPrintReady events, printer and report payloads, and routing reports to email, physical, or other printer endpoints.

Path: Development > Programming in the AL language > Developing printer extensions · tier official · system development · narrative reviewed (checked by Opus)

Overview

A printer extension is an AL extension that subscribes to events published by the Report Management codeunit. It registers custom printers and then receives the finished report so it can send it to a web-connected printer, an email address, or another endpoint.

The section has two pages and no subtopics. “Developing printer extensions in Business Central” gives the overview: what a printer extension is and which events it uses. “Creating a Printer Extension” covers the building steps: setting up printers, the JSON printer payload, paper tray configuration, the Printer Selections page, and routing reports.

Start with the overview page to understand the two events, then follow the creation page to implement them.

Key points

  • Printer extensions send reports directly to web-connected printers.
  • Subscribe to OnAfterSetupPrinters to define and register custom printers.
  • Subscribe to OnAfterDocumentPrintReady to receive the report and route it to its destination.
  • Both events are published by the Report Management codeunit.
  • Printers are described with a JSON printer payload, which can include paper tray configuration.
  • Printers added this way can be chosen on the Printer Selections page.
  • Reports can be routed to email, physical printers, or other printer endpoints.

Learn pages

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 2 Learn pages