I am building an XSLT document that is iterating over XML nodes and producing a report. When there are only 5 or so lines on this report I need to pad this out with empty rows.
I have been trying to follow the example from here XSLT : Looping from 1 to 60 however this example does work and recurse the amount of times i need it to, but I cannot get it to format or use borders.
An example of what I currently using without padding is
<xsl:template match="//t:formulas/t:formula/t:formulaItems/t:formulaItem">
<xsl:variable name="position">
<xsl:number count="//t:fs/t:f/t:Items/t:Item" />
</xsl:variable>
<xsl:variable name="materialCode" select="t:materialCode"/>
<Border Grid.Column="0" Style="{{StaticResource borderStyle}}">
<Grid.Row>
<xsl:value-of select="$position + 4" />
</Grid.Row>
</Border>
<!-- SEQ -->
<Border Grid.Column="0" Style="{{StaticResource borderStyle}}">
<Grid.Row>
<xsl:value-of select="$position + 4" />
</Grid.Row>
<TextBlock Grid.Column="1" VerticalAlignment="Center" FontSize="12" HorizontalAlignment="Center">
<xsl:value-of select="$position" />
</TextBlock>
</Border>
<!-- Material -->
<Border Grid.Column="1" Grid.ColumnSpan="2" Style="{{StaticResource borderStyle}}">
<Grid.Row>
<xsl:value-of select="$position + 4" />
</Grid.Row>
<TextBlock Grid.Column="1" Grid.ColumnSpan="2" VerticalAlignment="Center" FontSize="12" HorizontalAlignment="Left">
<xsl:value-of select="t:Code" />
</TextBlock>
</Border>
</Border>
</xsl:template>
There are 5 other columns that i am working with but if i can get these two columns I will be able to get the rest.
Any and all help is very much appreciated.
Thank you
No comments:
Post a Comment