samedi 18 avril 2015

Excel xslt rowcount

I have an xml (for brevity sake):



<row>...</row>
<row>...</row>
<row>...</row>
<row>...</row>
<row>...</row>


the last "row" contains the totals, so I was trying to do something like this in the excel xslt (the number of "row" are dynamic)



<Cell ss:Formula="=SUM(R[-{count(row)}]C:R[-1]C)">
<Data ss:Type="Number">
<xsl:value-of select="." />
</Data>
</Cell>


Because of circular reference problem, I need to get the count of row-1. I've tried:



ss:Formula="=SUM(R[-{count(row)-(count(row)-1)}]C:R[-1]C)"

ss:Formula="=SUM(R[-({count(row)})-(count(row)-1)]C:R[-1]C)"


but none of those are working. I know I could change the last "row" to "totals" and the row count would be right, but I'd like to do it w/o changing the xml.


Can someone help me with the syntax?


Thanks in advance!!!


Aucun commentaire:

Enregistrer un commentaire