want to group by a multiple column of list dynamically
wanted do group by on multiple list column where i can pass column name and order of which they can group by can any one help me. please let me know is it possible or not?
You need to use the xsl:sort to sort the data, you can use multiple sort statements to sort by more than one field. If I remember correctly you can not use a variable in the sort statement, you will need to do a xsl:choose/xsl:when to switch to the different sort statements based on some input.
I have used a xsl:sort and also set the variable in xsl choose/xsl:when but while populating the records it is giving me error as variable must set as node-set so i used msxsl:node-set function.but after using this it will giving me error but not showing any result. so i used msxsl:node-set($test)*/.This is showing result . but I am populating data from 3 different list in single dataview. if i set variable like above in 1st list then 2nd and 3rd list is not populating any value. if i set variable like this in 2nd list 3rd list is not populating. can you please reply this I do not understand what is */ stands for.
after getting this by using a subview i am gettiing data from my second list but my second list not showing any data. and does not give any error so i am not able to understand the problem.
If i directlly assign my query to rows variable then It will not have any problem.
The ./* is to select all nodes, of any name below the current page. Please excuse my poor copy & paste, as select="$selectedNodes" should not be in the apply-templates tag.
I would suggest simplifying your select statement if you are not getting any results, to work out what is causing the problem.
i am listing data from 3 list in single view i have 3 select Queries I want that 3 select Query as dynamic so i set them in variable and applying that variable to my select clause by setting a node-set my first list is showing data but second third list not showing any thing.
want to group by a multiple column of list dynamically
wanted do group by on multiple list column where i can pass column name and order of which they can group by can any one help me. please let me know is it possible or not?
You need to use the xsl:sort to sort the data, you can use multiple sort statements to sort by more than one field. If I remember correctly you can not use a variable in the sort statement, you will need to do a xsl:choose/xsl:when to switch to the different sort statements based on some input.
Richard
hi Richard,
Thanks for reply.
I have used a xsl:sort and also set the variable in xsl choose/xsl:when but while populating the records it is giving me error as variable must set as node-set so i used msxsl:node-set function.but after using this it will giving me error but not showing any result. so i used msxsl:node-set($test)*/.This is showing result . but I am populating data from 3 different list in single dataview. if i set variable like above in 1st list then 2nd and 3rd list is not populating any value. if i set variable like this in 2nd list 3rd list is not populating. can you please reply this I do not understand what is */ stands for.
I would tackle this problem like this:
To start creating the XSLT do:
hi Richard,
I would like to know what /* does?
like i said i am getting data from 3 list as a subview of one after the other.
Table
//settting a variable to assign to rows variable by checking user in which group.
<xsl:template name="dvt_1">
<xsl:variable name="dvt_StyleName">Table</xsl:variable>
<xsl:variable name="test" >
<xsl:choose>
<xsl:when test="$useringroup='PO'">
<xsl:copy-of select="/dsQueryResponse/Process/Rows/Row[@ActiveState='1' and string(substring-after(substring-after(substring-before(string(@ProcessOwner),'</A>'),'ID='),'>')) = $UserID and string(@ProcessState)!='New']"></xsl:copy-of>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
<!--<xsl:call-template name="filter"></xsl:call-template>-->
</xsl:variable>
// assigning that variable here if i do not use/* then it will not show any result.
<xsl:variable name="Rows" select="/dsQueryResponse/Process/Rows/Row[@ActiveState='1' and string(substring-after(substring-after(substring-before(string(@ProcessOwner),'</A>'),'ID='),'>')) = $UserID and string(@ProcessState)!='New']"></xsl:variable><xsl:variable name="dvt_RowCount" select="count($Rows)" /><xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0" /><xsl:choose>
<xsl:when test="$dvt_IsEmpty">
<xsl:call-template name="dvt_1.empty" />
</xsl:when>
<xsl:otherwise><table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse" bordercolor="#d1e2fc">
<tr valign="top">
<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
<th class="ms-vh" nowrap="nowrap"></th>
</xsl:if>
<th class="ms-vh" nowrap="" style="width:100px;border-right:1px solid white;padding-left:35px;">Test Name</th>
<th class="ms-vh" nowrap="" style="display:none">Test Instructions</th>
<th class="ms-vh" nowrap="" style="border-right:1px solid white;">Test Frequency</th>
<th class="ms-vh" nowrap="" style="border-right:1px solid white;">Test Period</th>
</tr>
<xsl:call-template name="dvt_1.body">
<xsl:with-param name="Rows" select="$Rows"/>
<xsl:with-param name="FirstRow" select="1" />
<xsl:with-param name="LastRow" select="$dvt_RowCount" />
</xsl:call-template>
</table></xsl:otherwise>
</xsl:choose>
</xsl:template>
after getting this by using a subview i am gettiing data from my second list but my second list not showing any data. and does not give any error so i am not able to understand the problem.
If i directlly assign my query to rows variable then It will not have any problem.
Pooja,
The ./* is to select all nodes, of any name below the current page. Please excuse my poor copy & paste, as select="$selectedNodes" should not be in the apply-templates tag.
I would suggest simplifying your select statement if you are not getting any results, to work out what is causing the problem.
hi Richard,
thanks but i am not getting what you are saying?
i am listing data from 3 list in single view i have 3 select Queries I want that 3 select Query as dynamic so i set them in variable and applying that variable to my select clause by setting a node-set my first list is showing data but second third list not showing any thing.
hi Richard,
i would like to ask you that after using /* are we able to itrate to any other node
is working on a reply...