none
SSRS report on SharePoint list and CAML, filter by person or group field with multiple entries

    Question

  • I would like to ask how can we input multiple people name in SSRS report to filter the data from a SharePoint multiple entries person and group field by CAML query.

    We have a SharePoint list with a multiple entries person or group field, e.g.

    | Title | Users |
    | Item 01 | User A, User B, User C |
    | Item 02 | User A, User C |
    | Item 03 | User D, User C |
    | Item 04 | User D, User E |

    When user input parameter "User A, User C", should return item 02.

    When user input parameter "User C", should return item 01, 02 and 03.

    Following is my CAML in my dataset:

    <RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <ListName>Cases</ListName>
      <ViewFields>
        <FieldRef Name="Title" />
        <FieldRef Name="Users" />
      </ViewFields>
      <Query>
        <Where>
          <Contains>
            <FieldRef Name="Users" />
            <Value Type="Text">
              <Parameter Name="Users" />
            </Value>
          </Contains>
        </Where>
      </Query>
    </RSSharePointList>

    Friday, January 10, 2014 2:57 AM

Answers

  • Hi,

    According to your post, my understanding is that you want to filter date from a multiple entries person and group field by CAML query.

    Please try to use the following CAML query to achieve it.

     
     <Query>
        <Where>
          <Contains>
            <FieldRef Name="Users" />
            <Value Type="UserMulti">
              <Parameter Name="Users" />
            </Value>
          </Contains>
        </Where>
      </Query>


    Best Regards


    Dennis Guo
    TechNet Community Support

    Monday, January 13, 2014 7:23 AM
    Moderator

All replies

  • Hi,

    According to your post, my understanding is that you want to filter date from a multiple entries person and group field by CAML query.

    Please try to use the following CAML query to achieve it.

     
     <Query>
        <Where>
          <Contains>
            <FieldRef Name="Users" />
            <Value Type="UserMulti">
              <Parameter Name="Users" />
            </Value>
          </Contains>
        </Where>
      </Query>


    Best Regards


    Dennis Guo
    TechNet Community Support

    Monday, January 13, 2014 7:23 AM
    Moderator
  • Thanks a lot
    Monday, January 20, 2014 9:22 AM