I tried inserting HTML with styles into repeating section XML, but it is rendered as plain text. Is it possible to insert HTML with styles for repeating sections?
Can you please provide more details about the specific Aspose product you are using and the code you have tried for inserting HTML into the repeating sections?
I’m using aspose words 21.6. Here is example of XML part:
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<Employee>
<Name><div style="color:#40B3DF;">John Doe</div></Name>
<HireDate>2018-03-01</HireDate>
<Gender>Male</Gender>
<Department>B</Department>
</Employee>
<Employee>
<Name><div style="color:#40B3DF;">Jane Adams</div></Name>
<HireDate>2017-01-17</HireDate>
<Gender>Female</Gender>
<Department>A</Department>
</Employee>
</root>
@bz.anton.kh Unfortunately, it snot quite clear how to reproduce the problem. Could you please attach your input, output and expected output documents along with code that will allow us to test the scenario on our side?
@bz.anton.kh Thank you for additional information. Unfortunately, I do not see any way to use HTML syntax in the SDT mapped value. Also, I do not see such option in MS Word.
@bz.anton.kh You can set formatting of SDT in your template. For example see the following modified template and output documents:
in.docx (19.5 KB)
out.docx (18.2 KB)
@bz.anton.kh I am afraid I do not see any way to achieve this using SDT mapping. You can consider using LINQ Reporting Engine to build the report. In this case you can insert HTML dynamically.
@bz.anton.kh You can find examples in our GitHub:
https://github.com/aspose-words/Aspose.Words-for-Java/tree/master/Examples/DocsExamples/Java/src/main/java/DocsExamples/LINQ_Reporting_Engine
Please let us know in case of any difficulties. We will be glad to help you.
@alexey.noskov could you please provide template.docx document with a correct tag? I have an error Tag 'managers' is not well-formed. Token 'managers' is unexpected.
I just added next text to the document body <<managers>><</managers>>
. Also, does the LINQ reporting engine support inner repeating sections?
@bz.anton.kh You should use <<foreach>>
. Please see our documentation more more information:
https://docs.aspose.com/words/net/outputting-sequential-data/
Yes, you can use inner <<foreach>>
statements.