Skip to main content

Generating and Printing Files Using File Templates

After file templates are created, you can generate and print files by calling the print service. This document describes how to use created file templates to generate and print Word documents and Excel documents.

Loading...
Print Word Template Interface

The data model used by the print service function must be consistent with the target data table of the template variables.

Print services are generally called in button events:

Loading...
Print Service Configuration

  1. In the event editing area, click "Please select" in the statement, select the "Print File Template" option under "Utility Functions" in the popup window, which will generate Utility Functions.Print File Template.
  2. Click the Set Parameters button of Utility Functions.Print File Template, and set the template type, file template, and assign values to template variables in the popup dialog.

The configured parameters are shown below:

Loading...
Configured Parameters

The usage effect is shown below:

Loading...
Usage Effect

Create a button in the component that needs to call template printing.

Loading...
Create Print Button

Configure button events:

Loading...
Configure Button Events

  1. In the event editing area, click "Please select" in the statement, select the "Print File Template" option under "Utility Functions" in the popup window, which will generate Utility Functions.Print File Template.
  2. Click the Set Parameters button of Utility Functions.Print File Template, and set the template type, file template, and assign values to template variables in the popup dialog.

Finally, verify the template printing effect:

Loading...
Template Printing Effect

Generating attachments

Create a button in the component that needs to call attachment generation.

Loading...
Create Attachment Generation Button

  1. In the event editing area, click "Please select" in the statement, then choose "Services" > "Utility Service" > "Generate Attachment" in the popup window. This will generate Service.Utility Service.Generate Attachment.
  2. Click the Set Parameters button of Services.Utility Service.Generate Attachment. In the popup dialog, set the Template Type, select the File Template, specify the name for the generated attachment, choose the output method, and assign values to the template variables.
JitAI AssistantBeta
Powered by JitAI