Tuesday, July 14, 2009

How to get TOTAL number of records under a group in Data View Web Part in SharePoint

Hi,
Few days back i was struggling with different aspects of Dataview webpart in sharepoint designer.
I badly need to show the total of records under each group as we were having different level of grouping in our DVWP.

Finally i got solution for that. I just want to share with you.

Here it is:-

Get Total of Rows under a group

{xsl:value-of select="count($nodeset)" /}

*To get total number of records in DVWP
{xsl:value-of select="count(/dsQueryResponse/Rows/Row)" /}

Replace curly brackets with angular brackets.
You will get the result what exactly you want.

Have a fun!!!

No comments: