Configure print to PDF

Print to PDF adds a Print action to an adaptive application. When a user selects it, the application’s data is passed to a linked PDF template, and the generated PDF opens in a new tab. The application and the PDF template must use the same connector, so the data matches the PDF interface.

Business use cases

Print to PDF turns the data a user is viewing into a document they can save, print, or email. Key scenarios include:

  • Records and receipts: Generate a formatted document from a single form, such as an order confirmation or a work order.

  • List reports: Generate a tabular report from a list, such as an inventory or a task list.

  • Chart reports: Print a chart from an adaptive business intelligence application alongside its data.

Prerequisites

This procedure uses the example of an Open Orders list to demonstrate how to add a Print button that generates a tabular PDF report from the list’s data. Before you start:

  • You have a connector for the data source.

    Example: An Orders connector, built from an Orders table definition with the fields Order Number, Customer, and Region.

  • You have an adaptive application that uses that connector, based on the adaptive list, adaptive edit, or adaptive tile chart template.

    Example: An Open Orders adaptive list application that uses the Orders connector as its data source.

  • You have a PDF template that uses the same connector as its interface, with an interface shape that matches the application, and its components bound to the same fields the application displays. See Use a connector as the PDF interface.

    Example: A PDF template orders_report that uses the Orders connector with the interface shape List, laying out the orders in a table bound to {/connector}, with the cells bound to {/connector/order_number}, {/connector/customer}, and {/connector/region}.

Procedure

  1. Open the adaptive application in the Adaptive Designer in edit mode.

    Example: Open the Open Orders application.

  2. Confirm the application uses the connector as its data source. In Application Settings, on the General tab, in the Data Source section, check the Connector field.

    Example: The Connector field holds the Orders connector.

  3. In the template settings under Properties, turn on Enable Print.

    Result: A Print action is added to the application, along with its settings and a Print event.

  4. Configure the Print settings as needed, for example, the button text or its visibility.

    Example: Set the button text to Print orders.

  5. In the Settings pane, in the Events section, set up the Print event to run the PDF template you prepared.

    You can only select PDF templates that use the same connector as the application.

    Example: Select the orders_report template. The Print event shows PDF: orders_report.

  6. Optional: To keep a copy of each generated PDF, in the Print event settings, select Save PDF in PDF Archive to enable saving the PDF to the PDF Archive tool. You can also provide a security key to assign a name to the PDF, making it easier to identify in the PDF Archive.

    Example: Enable saving so that every printed orders report is archived.

  7. Optional: to make the application load its data as soon as it opens, in Properties, turn on Run at Start and Run at Focus.

  8. In the Shell bar, select Save.

  9. In the Preview pane, select Print to confirm the result.

    • At the list level, the Print action generates a report of the whole list.

    • On an individual row, the Print action generates a report for that entry.

    Example: Selecting Print on the Open Orders list opens a new tab with a PDF that lists each order in a table, with Order Number, Customer, and Region as the column headers.

Result

  • You have configured a Print action that generates a PDF from the application’s data and opens it in a new tab. The same fields must be present in both the application and the PDF for the data to map across.

  • If you enabled saving, the PDF is also stored in the PDF Archive, with the security key if you provided one.

Print to PDF works with Enable Strict Content Security Policy turned on in the system security settings.
To print a single record from a list in a detailed layout, set up the list application’s Item Press event to open an adaptive edit application (see Create an event in guided mode). The edit application uses the same connector with the interface shape Details, so the user opens a row, then selects Print to generate a single-record PDF.