You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
I want to create a docx that merges subdocs based on given inputs(docx has x, y, and z sections from merged subdocs that are separate docx files), and then populates variables(name, pronoun, etc.) throughout the entire docx. I can get each to work separately(name is inserted throughout template); or subdocs are merged into template and saved. When I try and have subdocs merged, and then variables populated(so that the tags in the subdocs are filled with appropriate info) the subdocs will merge, but no tags are rendered.
How to create docx from template that merges subdocs, and then autoreplaces all input variables?
Attempted:
I have tried to add all subdocs needed and text variables into a single dictionary and then rendering. I have tried to render subdocs first, but only the 1st subdoc gets merged, and then all text variables are replaced with white space.
Code:
`for variable in ["firstName", "lastName"]:
demographics[variable] = eval(variable)
Problem:
I want to create a docx that merges subdocs based on given inputs(docx has x, y, and z sections from merged subdocs that are separate docx files), and then populates variables(name, pronoun, etc.) throughout the entire docx. I can get each to work separately(name is inserted throughout template); or subdocs are merged into template and saved. When I try and have subdocs merged, and then variables populated(so that the tags in the subdocs are filled with appropriate info) the subdocs will merge, but no tags are rendered.
How to create docx from template that merges subdocs, and then autoreplaces all input variables?
Attempted:
I have tried to add all subdocs needed and text variables into a single dictionary and then rendering. I have tried to render subdocs first, but only the 1st subdoc gets merged, and then all text variables are replaced with white space.
Code:
`for variable in ["firstName", "lastName"]:
demographics[variable] = eval(variable)
report.render(demographics)
subdocinput = report.new_subdoc('subdocfile.docx')
subdocinput2 = report.new_subdoc('subdocfile2.docx')
for tests in {"subdocinput", "subdocinput2"}:
assessments[tests] = eval(tests)
report.render(assessments)`
The text was updated successfully, but these errors were encountered: