python-docx-template
python-docx-template copied to clipboard
Forms and documents are corrupted when using vm tags
Describe the bug
A clear and concise description of what the bug is.
my template:
my result:
There are only 2 rows, and the rest of the forms and documents have all disappeared
To Reproduce
python 3.6.6, docxtpl==0.16.7,python-docx==0.8.11
Please, provide a fully runnable test case, not just pictures.
Message ID: @.***>
Please, provide a fully runnable test case, not just pictures. … Message ID: @.***>
from docxtpl import DocxTemplate, InlineImage
tpl = DocxTemplate('./test.docx')
context = {
'repeat_purchase_list': [{'total': 100, 'name': 'A', 'count': 1}, {'total': 200, 'name': 'B', 'count': 1},
{'total': 300, 'name': 'C', 'count': 1}, {'total': 400, 'name': 'D', 'count': 1}
]
}
tpl.render(context)
tpl.save('./out.docx')
I upload my test docx template,thankyou.
I confirm the bug and I got workaround.
I selected the table and changed the style to Normal (test Normal style.docx). The output document was as excpected.
I found out that changing the font didn't resolve the bug.
I confirm the bug and I got workaround.
I selected the table and changed the style to Normal (test Normal style.docx). The output document was as excpected.
I found out that changing the font didn't resolve the bug.
Thanks.