aspose-words / Aspose.Words-for-Java

Aspose.Words for Java examples, plugins and showcases
https://products.aspose.com/words/java
MIT License
401 stars 206 forks source link

reporting engine how to fill in content controls #96

Closed earthskin closed 1 year ago

earthskin commented 1 year ago
report = aw.reporting.ReportingEngine()
report.build_report(doc, test_data)

if doc has some <<aaa>> tag in content controls, data cann't fill in this content controls. how can i fill content controls with data?

AlexNosk commented 1 year ago

@earthskin Could you please attach your sample template and data here for testing? We will check the issue and provide you more information. I have created a simple template with data placeholder in the main body and in the content control and both are properly filled with data. Please see the attached documents and the code: in.docx out.docx

doc = aw.Document("C:\\Temp\\in.docx");
engine = aw.reporting.ReportingEngine()
engine.build_report(doc, "This is my value", "value")
doc.save("C:\\Temp\\out.docx")

PS: placeholder should look like this <<[aaa]>>, not like this <<aaa>>.