SSRS:如何在针对SharePoint列表创建报表时指定ViewAttributes

时间:2012-08-13 12:55:11

标签: sharepoint-2010 reporting-services reportbuilder

客户正在尝试使用Report Builder 3.0针对SharePoint列表构建报表。他正试图在子文件夹中包含项目。对于前者通过使用CAML(即在此上下文中,SharePoint的查询语言),您可以通过指定<ViewAttributes Scope=”Recursive”/>来完成此操作:结果集包含子文件夹中的项目。

那么,如何在报告中指定相同的内容?我无法通过直接查询列表找到正确的语法:

<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ListName>testlist</ListName>
  <ViewFields>
    <FieldRef Name="LinkTitleNoMenu" />
    <FieldRef Name="Author" />
  </ViewFields>
</RSSharePointList>

也不是列表Web服务(lists.asmx):

<Query>
       <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
       <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
          <Parameters>
             <Parameter Name="listName">
                <DefaultValue>testlist</DefaultValue>
             </Parameter>
             <Parameter Name="rowLimit">
                <DefaultValue>1000</DefaultValue>
             </Parameter>
          </Parameters>
        </Method>
        <ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>

尝试将其作为查询的参数插入,例如

     <Parameter Name="viewAttributes">
        <DefaultValue><ViewAttributes Scope="Recursive"/></DefaultValue>
     </Parameter>

但没有运气(还)。

指针,赞赏。提前谢谢。

1 个答案:

答案 0 :(得分:1)

找到了......

<Query>
<SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
       <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
          <Parameters>
             <Parameter Name="listName">
                <DefaultValue>testlist</DefaultValue>
             </Parameter>
             <Parameter Name="rowLimit">
                <DefaultValue>1000</DefaultValue>
             </Parameter>

   <Parameter Name="queryOptions" Type="xml">     
    <DefaultValue>
     <QueryOptions>
      <ViewAttributes Scope="Recursive" />
     </QueryOptions>
    </DefaultValue>
   </Parameter>

          </Parameters>
        </Method>
        <ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>