Closed RThomasHyde closed 7 years ago
Never mind, I was misguided. I assumed that RepeatingContent was the same thing as a repeating section in docx, but after looking through unit tests I have seen the error of my ways
Hi RThomasHyde, I didn't understand you exactly, so RepeatingContent we can't use as repeating section in docx. Then how can I fill repeating section with data for example: [This is repeating section [TestField1] etc]
Then output I want to be like: This is repeating section value 1 etc This is repeating section value 2 etc
How can I accomplish this? Can you explain please!
I finally figured this out. In order to repeat content, you just put your content placeholders inside a Rich Content control. Do not use the Repeat Section Content Control as it will not work. The template engine takes care of the process of making copies of the items.
Either RepeatContent doesn't work, or I have the wrong idea about how to use it. I have created a very simple docx (in Word 2013) containing a single repeating section with Title and Tag both set to "TestRepeater." The content of the repeating section is a single text field named/tagged "TestField" followed by a carriage return. When I try to fill it with two lines of content using code like below, I end up with a "Field content for field '' not found" error message in the output, and the repeating section remains unfilled and is not removed, but is duplicated.
What I really want is a repeating section with a header field and a table inside, so that I can generate a series of (an unknown number of) tables with each table bearing a title. But until I have a repeating section working, I don't see how to proceed.
RepeatingSectionTest.docx