0

I have a 5 columns DVWP created using a linked data source (of 3 SP tables). The first 3 columns are from the first SP table, while the 4th and 5th column are from the remaining 2 SP tables.

In the DVWP tools > design options, i have ticked the Sort and Filters on Headers option, but the filter only appears on the first 3 columns. I want it so that all 5 columns will have its own filter.

I tried to add the filter manually to the remaining 2 columns using XSL. I've added the following xsl to the DVWP codes (which i believe is the code to enable the filter on the remaining 2 columns)

<th class="ms-vh" nowrap="nowrap">
    <xsl:call-template name="dvt.headerfield" ddwrt:atomic="1" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
        <xsl:with-param name="fieldname">@Column4</xsl:with-param>
        <xsl:with-param name="fieldtitle">Column 4</xsl:with-param>
        <xsl:with-param name="displayname">Column 4</xsl:with-param>
        <xsl:with-param name="sortable">1</xsl:with-param>
        <xsl:with-param name="fieldtype">x:string</xsl:with-param>
    </xsl:call-template>
    </th>
    <th class="ms-vh" nowrap="nowrap">
    <xsl:call-template name="dvt.headerfield" ddwrt:atomic="1" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
        <xsl:with-param name="fieldname">@Column5</xsl:with-param>
        <xsl:with-param name="fieldtitle">Column 5</xsl:with-param>
        <xsl:with-param name="displayname">Column 5</xsl:with-param>
        <xsl:with-param name="sortable">1</xsl:with-param>
        <xsl:with-param name="fieldtype">x:string</xsl:with-param>
    </xsl:call-template>
    </th>

And with the above, the filter finally appears on the remaining 2 columns. However when i tried to open the filter, unlike the first 3 columns, the filter on 4th and 5th column doesn't show any list of values that i can pick to filter that column.

Can anyone help me figure out what was wrong here?

0

Add one more parameter and check it.

<xsl:with-param name="nodeset" select="msxsl:node-set($dvt_Rows)/root//Row[((@Column_x0020_5)='Your Value')]" />
  • I think you added that parameter because i put the fieldname as Column 5. Its typo actually. Its Column5, which i have edited above. – Fred A Apr 20 '16 at 9:18
  • Sorry for late reply. Have you tried it? – Viraj Gorajia Apr 20 '16 at 10:39
  • Have you tried it with filter option from SharePoint designer? – Viraj Gorajia Apr 20 '16 at 10:45
  • I tried. It only enables sort and filtering for the first 3 columns. The remaining 2 columns have no sort and filtering no matter how i ticked the option on SPD. That is why i thought maybe it can be enabled by modifying the XSL, but i'm not sure how to make it works. – Fred A Apr 21 '16 at 4:20
  • I try my best to help you. Can you use query string (URL) filter webpart? – Viraj Gorajia Apr 21 '16 at 5:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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