SharePoint列表的SQL Reporting Services报表 之2

本文探讨了在SQL Reporting Services (RS) 中向SharePoint列表的Webservices方法传递参数时遇到的问题,特别是针对XML类型参数的支持不佳情况,并提出了可能的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

前几天写了 Tip - SharePoint列表的SQL Reporting Services报表, 这几天又在研究如何由报表传递参数到SharePoint 列表的web services 方法上。得出如下结论:

1. 值类型的参数象string, integer等RS本来就支持的参数没有什么问题

2. xml类型的参数支持的不好,象GetListItems方法中的query参数为xml类型:

<GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>string</listName>

<viewName>string</viewName>

<query> <xsd:schema>schema</xsd:schema>xml</query>

<viewFields> <xsd:schema>schema</xsd:schema>xml</viewFields> <rowLimit>string</rowLimit>

<queryOptions> <xsd:schema>schema</xsd:schema>xml</queryOptions> <webID>string</webID>

</GetListItems>

参数值表达式在报表数据集编辑中的参数编辑框中 输入类似如下的CAML query

<Query>
<Where>
<Geq>
<FieldRef Name="Created" />
<Value Type="DateTime">
<Today />
</Value>
</Geq>
</Where>
</Query>

运行报表,提示web service方法出错,原因是invalid parameter of query! 通过Fiddler观察Soap请求发现,以上参数在soap包中的格式根本不正确, 例如字符 '<' 被转换为"&#060;",显然是被RS html encoded了。

又尝试了CAML参数,报表数据集的查询如下:

<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>Test Please History</DefaultValue>
</Parameter>
<Parameter Name="rowLimit">
<DefaultValue>10</DefaultValue>
</Parameter>
<Parameter Name="query" Type="xml">
<DefaultValue>
<Query>
<Where>
<Geq>
<FieldRef Name="Created" />
<Value Type="DateTime">
[parameterDate]
</Value>
</Geq>
</Where>
</Query>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
</Query>

参数parameterDate又无法跟报表参数关联。

可能唯一的办法就写自定义的RS extension来处理xml参数,或使用一些商业产品,例如 Enesys RS Data Extension

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值