Go to the Templates tab in the form administration.
Then click on New Template.
Assign a name to your template.
Once created, access your template by clicking on its name.
Next, you will see the option to upload your template.
In Microsoft Word or Excel, you can use the values of your form fields as template parameters. Copy the field labels from the template settings.
To insert a field in the Word or Excel template, simply paste the field label in double brackets {{}}.
To print table type fields in the template, we create a table in the Word document that must have 3 columns:
Table header
In the first cell of the table in Word, we open the iteration by the values of our table.
{%tc for col in metadata_invoice_items.col_labels %}
metadata_invoice_item is the label of your table type field, which you must copy like any other field.
A continuación, en las celda continua ponemos:
{{ col }}
In the template a column will be generated for each column you have defined in the itable field.
Finally, in a third cell, you must close the header loop.
{% tc endfor %}
Table body
Next, in a new row, we will open the loop that will loop through the values in the table.
{%tr for item in metadata_invoice_items.content %}
metadata_invoice_item is the label of your table type field, which you must copy like any other field.
Then, in the next row, first cell, we open a new loop:
{%tc for col in item.cols %}
Next, in the continuous cell we put:
{{ col }}
In a third cell, you must close the header loop.
{% tc endfor %}
Finally, in a new row, you must close the first loop.
{% tr endfor %}
As a result of the previous example, we will obtain a table:
From the itable field:
You can access more detailed information on how to create a template with Jasper Reports from our Template Composition course.
Comments
0 comments
Please sign in to leave a comment.