0
votes

I have to bind iterated tables to word document using open xml. I.I can able to bind single table to word document.Word final view

i am able to bind single table header 1 shown in image using book mark.

Could you please provide some ideas to bind multiple tables dynamically.Here in above image header 1 ,header 2 are dynamic ..IT may goes until header N..

Can any one provide some ideas to how to proceed on this .

1

1 Answers

0
votes

I think you are looking for something like this -

foreach(HeaderPart headerPart in docGenerated.MainDocumentPart.HeaderParts)
    {
        foreach(Table table in headerPart.Header.Descendants<Table>())
        {
            // do whatever you want to do with your table.
        }
    }