SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Creating multiple repeating groups within another repeating group


Creating multiple repeating groups within another repeating group

Author
Message
kyagi.jo
kyagi.jo
SSC Eights!
SSC Eights! (883 reputation)SSC Eights! (883 reputation)SSC Eights! (883 reputation)SSC Eights! (883 reputation)SSC Eights! (883 reputation)SSC Eights! (883 reputation)SSC Eights! (883 reputation)SSC Eights! (883 reputation)

Group: General Forum Members
Points: 883 Visits: 484
Hi,

I have some XML like the following

<Root>
<Meters>
<Meter>
<Reads>
<Read>...</Read>
<Read>...</Read>
<Read>...</Read>
</Reads>
<LineItems>
<LineItem>...</LineItem>
<LineItem>...</LineItem>
<LineItem>...</LineItem>
<LineItem>...</LineItem>
</LineItems>
</Meter>

<Meter>
<Reads>
<Read>...</Read>
<Read>...</Read>
<Read>...</Read>
</Reads>
<LineItems>
<LineItem>...</LineItem>
<LineItem>...</LineItem>
<LineItem>...</LineItem>
<LineItem>...</LineItem>
</LineItems>
</Meter>
</Meters>
</Root>

So for each <Meters> node, I can have multiple <Meter> nodes, for each <Reads> node, I can have multiple <Read> nodes, for each <LineItems> node, I can have multiple <LineItem> nodes. The contents within a <Read> node is completely different from the contents within a

I am trying to convert this XML so that it can be displayed in a tablix, where the table grouping is on the meter node (so for each meter, this will create a row in the tablix), and for each row in the table, then I was looking to have this do its own grouping within it, with the <Reads> node being its own table within the tablix, that expands, depending on how many of the <Read> nodes there are, and then on the same level, then another grouping in another tablix for the <LineItems>, which will expand depending on how many <LineItem> nodes there are.
For each <Meter> node, there will only be one <Reads> and <LineItems> node.
I imagine that the tablix for the <LineItem> and the tablix for the <Read> nodes are both within a cell of the tablix for the <Meter> nodes, so it is basically a repeating group, and within it, I have two more repeating groups.

Is this possible? It sounds possible in my head, but the main roadblock in my way is how do I create a single dataset from the XML that can do this? It needs to be a single dataset, so that I can do the grouping on the meter node I think? I wouldn't be able to do grouping on disparate datasets.
I can take blocks of XML that can be represented by a block by using the
<Query><XMLData>...</XMLData><ElementPath>...</ElementPath></Query> method, but if it is possible to use this to extract data out of a data source where the XML datasource is more complex.

If this is possible, does anyone have any examples of this being done?

Any help would be extremely welcomed.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search