Friday 15 January 2010

c# - Word 2013 Nested Repeating Section Content Controls -



c# - Word 2013 Nested Repeating Section Content Controls -

i'm having problem nesting repeating section controls within other repeating section controls.

imagine i'm enumerating servers in vm hosts in environments in datacenters

datacenter1 environment1 vmhost1 server1 server2 vmhost2 server3 server4 environment2 vmhost3 server5 ...

my document needs have number of repeating hierarchical sections. basic construction of document:

datacenter1 header description text ----- environment1 table --------- | header1 | header 2 | header 3 | |--------------------------------| | vmhost1 | server1 | ........ | | | server2 | ........ | |--------------------------------| | vmhost2 | server3 | ........ | | | server4 | ........ | ---------------------------------- ----- environment2 table --------- | header1 | header 2 | header 3 | |--------------------------------| | vmhost3 | server5 | ........ | ---------------------------------- datacenter2 header description text ----- environment3 table --------- | header1 | header 2 | header 3 | |--------------------------------| | vmhost1 | server1 | ........ | | | server2 | ........ | |--------------------------------| | vmhost2 | server3 | ........ | | | server4 | ........ | ----------------------------------

as can see, i'll need number of nested content controls.

but funky behavior. when add together nested repeating section, removes repeating command outside of supposed wrapped around table row.

other times, think i've got setup correctly, , test click [+] repeat entire datacenter section, more repeat section, or repeats other sections in same section.

i'm not using grouping functionality - , unsure if should or how help if did.

hopefully not bug in implementation, , i'm doing wrong .. i'm worried 'advanced' scenario not supported.

ultimately, locking these controls downwards in ui, , populated using custom xml parts injected open xml sdk. have number of other sections in document - including repeating parts - working fine, repeating sections aren't nested.

i've got xml construction should back upwards nesting, , worked way downwards mapping these controls well, until modified xml add together more children various nodes test repeating sections. in cases removed entire sections, in others repeated nested kid nodes parents, repeating entire tables.

i guess questions are: 1. if you've nested repeating sections, how? 2. if you've run these funky behaviors, how did work around it? 3. purpose of grouping functionality respect sets of content controls, repeating sections, , should using them accomplish this?

i've managed working. here illustration doc: http://1drv.ms/1nkmgvf used this tool help naming, binding (automap!), & navigating content controls.

it looks problem combination of 2 things:

incompatible xml structure mixing paragraph-based repeating sections within table-based repeating sections

incompatible xml prepare problem nested paragraph repeats in cell in repeating table row, wrapping repeating elements outer element:

<relativeroot> <nonrepeatingnode/> <table> <repeatingtablerow> <text1/> <text2/> </repeatingtablerow> <repeatingtablerow> <text1/> <text2/> </repeatingtablerow> </table> </relativeroot>

but caused problems when adding repeating elements via xml, or using built-in word functionality add together repeating section. changed following(removed <table>):

<relativeroot> <nonrepeatingnode/> <repeatingtablerow> <text1/> <text2/> </repeatingtablerow> <repeatingtablerow> <text1/> <text2/> </repeatingtablerow> </relativeroot>

mixed repeating sections

repeating sections can typically wrap paragraph text, appears when repeating section within table cell, row wrapped repeating section, causes problems rendering nested repeats.

here representation of hierarchy before:

repeating section command ^-> table ^-> row (fixed, non-repeating) ^-> column1a: plain text command ^-> column2a: table ^-> repeating section command ^-> row ^-> column1b: plain text command ^-> column2b: repeating section command ^--> plain text command ^-> column3a: repeating section command ^-> plain text command - repeats within column3a work - repeats of row column1b/2b not

and here after:

repeating section command ^-> table ^-> row (fixed, non-repeating) ^-> column1a: plain text command ^-> column2a: table ^-> repeating section command ^-> row ^-> column1b: plain text command ^-> column2b: table ^-> repeating section command ^-> row ^--> column1c: plain text command ^-> column3a: repeating section command ^-> plain text command

there may additional ways create work (check here), whatever reason not create work.

c# ms-word openxml openxml-sdk word-2013

No comments:

Post a Comment