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.
Printing Word templates
Loading...
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...
- 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.
- Click the
Set Parametersbutton 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...
The usage effect is shown below:
Loading...
Printing Excel templates
Create a button in the component that needs to call template printing.
Loading...
Configure button events:
Loading...
- 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.
- Click the
Set Parametersbutton 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...
Generating attachments
Create a button in the component that needs to call attachment generation.
Loading...
- 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. - Click the
Set Parametersbutton ofServices.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.