【发布时间】:2012-04-21 21:05:28
【问题描述】:
我正在尝试基于 Sharepoint (2010) 列表构建 SSRS (2008R2) 报告。 主要问题是报告将运行的列表必须是报告参数。我知道列表结构将是什么,但是共享点站点可以包含多个具有这种结构的列表实例,并且在运行报告时,用户必须选择列表名称。 此外,报表有两个日期参数,MinDateTime 和 MaxDateTime,并且只选择时间在这两者之间的记录。
据我所知,构建报告至少有两种方法:
-
使用 Sharepoint List Data Source 并用 CAML 编写 Dataset 查询,在 DataSource 中指定站点,让 SSRS 处理其余细节。这种情况下的问题是我无法将 ListName 指定为报告参数。 DataSet 查询如下所示:
<pre> <RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ListName>BusinessList1</ListName> <ViewFields> <FieldRef Name="Title" /> <FieldRef Name="BusinessUnit" /> <FieldRef Name="ScanDateTime" /> </ViewFields> <Query> <Where> <And> <Geq> <FieldRef Name="ScanDateTime" /> <Value Type="DateTime"> <Parameter Name="MinScanDateTime" /> </Value> </Geq> <Leq> <FieldRef Name="ScanDateTime" /> <Value Type="DateTime"> <Parameter Name="MaxScanDateTime" /> </Value> </Leq> </And> </Where> </Query> </RSSharePointList> -
使用 XML 数据源并以肥皂可读的 XML 编写数据集查询,直接访问 /_vti_bin/lists.asmx 网络服务。查询应该看起来像这样(包括列表名称作为参数)。但是,我无法使用 Date 参数让它工作。应该在哪里添加?
<pre> <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>BusinessList1</DefaultValue> </Parameter> <Parameter Name="viewFields"> <ViewFields> <FieldRef Name="Title" /> <FieldRef Name="BusinessUnit" /> <FieldRef Name="ScanDateTime" /> </ViewFields> </Parameter> </Parameters> </Method> <ElementPath IgnoreNamespaces="True">*</ElementPath> </Query>
任何方向都会很棒。 谢谢,
【问题讨论】:
-
如果您需要对任意 SharePoint 列表进行大量报告,可能值得使用 enesyssoftware.com/language/en-US/Products/… 等第三方工具。
-
@JonH - 谢谢,看起来不错,但我宁愿坚持“从不接触数据库”共享点规则。
-
@Jamie F - 也看过,但我们不能在这个项目中使用它。
标签: sharepoint sharepoint-2010 reporting-services