通过SQL Reporting Services连接sharepoint列表

1.先要安装SQL Reporting Servers,这个网站资料很多,在这里就不提了。
2.在Microsoft SQL Server 2005中打开SQL Server Business Intelligence Development Studio
3.新建项目,在左边的项目类型中选“商业智能项目”,右边 模板中选“报表服务器项目”

4.添加新的数据源,在解决方案资源管理器下,右击“共享数据源”选“添加新数据源”

5.在“共享数据源”中类型选XML,连接字符串为 http://<server>/<path>/_vti_bin/lists.asmx
其中:<Server>是你的服务名。
<Path>是列表存放的位置(可以不要)

6.右击报表->添加->新建项

选择报表。

7.新建数据集

配置数据集
命令类型->Text
查询字符串:
<Query>
<SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems<;/SoapAction>
<Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
</Method>
</Query>

8.设置参数,值是MOSS列表的GUID可以用Stramit CAML Viewer 来找到。(注意大小写)


参数的说明:(俺的英文不行)
listName
This tells the web service where to get the data from and it is the only required parameter.  You can give it either a list name or a Guid.  If you are unsure how to get the Guid, fire up Stramit CAML Viewer and browse to the list or simply click Settings->List Settings while viewing the list.  The list Guid will be URL encoded in the querystring after 'List=".  You can quickly decode it here.
viewName
The viewName tells the web service what view of listName to query in order to pull back data.  This is not required but strongly recommended because the Report Designer mangles the query parameter with severely limits your options for filtering data from the designer side of this process.  This is also an extremely picky parameter and I have yet to be able to get it to work consistently with a actual name of a view and have had to always use a Guid.
Note: If you do not specify a viewName, it will use whatever view is defined as the default for the list as the filter/sort for the data.  This is usually the All Items view and will likely include way more data than you want.
query
Do not use this parameter.  It is extremely useful for people calling the web service from code but does not work with the report designer.  I suspect that designer does some extra encoding of the CAML that this parameter normally accepts which confuses the web service to no end.  If someone finds a way to actually use this parameter from designer, please let me know!
rowLimit
The number of items to return.  SharePoint defaults to 100 so if you need more than this, you will need to include this parameter along with a number exceeding the number of rows you are likely to get.
queryOptions
Do not use this parameter for the same reason as query: it gets improperly encoded by the report designer.
9.添加字段,然后点确定


其中字段的值在后面会讲到。
不知道什么问题,在点完确定后会弹出

如果点击“字段刷新”也会出现这个问题,不过问题不大,点确定就是了。然后再点 !这个标记。输入listName,跟viewName的GUid的址。确定就可以看到数据了。看到标题栏上那个ows_Title没有。就在添加字段时的那个值。

在这里特别要感谢风铃的帮助。
英文地址:http://www.sharepointblogs.com/dwise/archive/2007/11/28/connecting-sql-reporting-services-to-a-sharepoint-list-redux.aspx
posted @ 2009-01-07 10:42  浪漫稻草人  阅读(614)  评论(0编辑  收藏  举报