QBench gives you the ability to upload .docx file documents as a report template. You can write Jinja code in your .docx document and QBench will evaluate and render your code. The generated document will be a .docx file instead of a .pdf file.
The Jinja syntax is mostly the same, you can reference these 3 resources for more information:
The only difference in syntax using for-loops. There are 3 different notations:
- {%p for sample in order.samples %} - Loop over Samples and use new lines for each iteration
- {%tr for sample in order.samples %} - Loop over Samples and use a Table Row for each iteration
- {%tc for sample in order.samples %} - Loop over Samples and use a Table Column for each iteration
** IMPORTANT **: The space between `%` and the tag name is important.
Incorrect:
{% tr for sample in order.samples %}
Correct:
{%tr for sample in order.samples %}
Here is an example of using all 3:
Paragraph Loop:
{%p for sample in order.samples %}
Sample ID: {{ sample.get_display_id() }}
{%p endfor %}
Table Row Loop:
Sample ID |
Sample Description |
{%tr for sample in order.samples %} |
|
{{ sample.get_display_id() }} |
{{ sample.description }} |
{%tr endfor %} |
Table Column Loop:
Sample ID |
{%tc for sample in order.samples %} |
{{ sample.get_display_id() }} |
{%tc endfor %} |
Description |
{%tc for sample in order.samples %} |
{{ sample.description }} |
{%tc endfor %} |
Comments
0 comments
Please sign in to leave a comment.