Nesting repeater within a table

Home Forums Open-Xml-PowerTools Nesting repeater within a table

This topic contains 1 reply, has 2 voices, and was last updated by  Eric White 7 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3402

    evgeniyd
    Participant

    Hi,
    For the last few months I’ve been developing using Open-Xml-PowerTools (.Net) and I am very happy with the results.
    There is one thing though that I don’t know how to do.
    I am trying to nest a repeater inside a table cell and I can’t get it working.

    This is my xml:
    <?xml version=”1.0″ encoding=”utf-8″?>
    <root>
    <activity>
    <child>
    <number>1</number>
    <firstname>Lady</firstname>
    <lastname>Gaga</lastname>
    <reg_dates>
    <reg_date>
    <date>4/26/2016</date>
    </reg_date>
    <reg_date>
    <date>4/28/2016</date>
    </reg_date>
    </reg_dates>
    </child>
    <child>
    <number>2</number>
    <firstname>Megan</firstname>
    <lastname>Fox</lastname>
    <reg_dates>
    <reg_date>
    <date>4/1/2016</date>
    </reg_date>
    </reg_dates>
    </child>
    </activity>
    </root>

    and inside my template.docx file I have

    <#<Table Select=”./activity/child” />#>
    (here is a simple two row table)

    Inside one of the cells on the second row I have a repeater:
    <#<Repeat Select=”./reg_dates/reg_date”/>#>
    <#<Content Select=”./date”/>#>
    <#<EndRepeat/>#>

    I’d like to know, if the PowerTools can handle a template with nest repeater within a table and if yes, what is the proper way to do that.

    Thanks

    #3480

    Eric White
    Keymaster

    This is not a feature of DocumentAssembler, unfortunately. It is a great idea though. I will add it to the list of suggested enhancements for DocumentAssembler.

    What I suggest is that you transform your XML to another form where your repeating data is in an XML element in your data, and then refer to that element in your table.

    Cheers, Eric

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.