Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a DVWP that displays groups of data. For each group, I've got a sum of one of the columns. This sum exists in the group footer in a template called dvt_1.groupfooter0.

<xsl:variable name="mySum" select="sum($nodeset/@myQuantity)"/>

Is there any way to filter out groups depending on this sum (e.g. if the sum is negative). I don't think that the "XSLT Filter" for the DVWP will work, since it appears to filter prior to grouping...so this doesn't work:

[sum(@myQuantity) > 0]

The above discards individual rows for which myQuantity is negative.

Any suggestions?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You'd need to add the full XPath to the filter on the nodeset. Stuff like this is typically quite hard to do if you work directly with the XSL which SharePoint Designer generates.

Another way to do it is in the dvt_1.body template, doing the calculation to determine if you should call the rowview template.

Bottom line is that it's doable with XSL magic.

M.

share|improve this answer
    
Thank you Marc. I will try this in the future. For this particular problem, I ended up just modifying my view in SQL Server. While I wish that things like this were easier to make happen in SPD + XSL, sometimes it just makes sense to do the heavy lifting on the back end. –  Boden Oct 25 '10 at 16:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.