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
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:
- 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 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:
The usage effect is shown below:
Printing Excel Templates
Create a button in the component that needs to call template printing.
Configure button events:
- 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 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: