一步一步實現(xiàn)ReportingServices2008匿名訪問
在ReportingServices2005中我們需要匿名訪問報表的時候,只需要在IIS里面做下簡單設(shè)置就可以實現(xiàn),而在ReportingServices2008(R2)中不在依靠IIS,只是占用的還是80端口而已。其實匿名訪問有很多中解決辦法,譬如:使用ReportViewer控件、與SharePoint集成等等......
下面我介紹SQL團隊技術(shù)博客所提供的比較徹底而且通用的方法 。(注:修改配置文件前如果害怕出問題請?zhí)崆皞浞?
第一步:編譯SQL團隊所提供的代碼并將所生成的Microsoft.Samples.ReportingServices.AnonymousSecurity.dll文件拷貝到SQL Server的安裝目錄*:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\bin下
你的項目中還需引用Microsoft.ReportingServices.Interfaces.dll 否則編譯會通不過
第二步:修改*:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer 和*:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager文件中的web.config文件,替換二者中的節(jié)點,將
- <authentication mode="Windows" />
- <identity impersonate="true"/>
替換為
- <authentication mode="None" />
- <identity impersonate="false"/>
第三步:修改*:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer修改rereportserver.config把
- <Authentication>
- <AuthenticationTypes>
- <RSWindowsNegotiate/>
- <RSWindowsNTLM/>
- </AuthenticationTypes>
- <EnableAuthPersistence>true</EnableAuthPersistence>
- </Authentication>
修改為
- <Authentication>
- <AuthenticationTypes>
- <Custom/>
- </AuthenticationTypes>
- <EnableAuthPersistence>true</EnableAuthPersistence>
- </Authentication>
第四步:修改*:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer修改rereportserver.config在
- <Security>
- <Extension Name="Windows" Type="Microsoft.ReportingServices.Authorization.WindowsAuthorization, Microsoft.ReportingServices.Authorization"/>
- </Security>
- <Authentication>
- <Extension Name="Windows" Type="Microsoft.ReportingServices.Authentication.WindowsAuthentication, Microsoft.ReportingServices.Authorization"/>
- </Authentication>
節(jié)點下,添加
- <Security>
- <Extension Name="None" Type="Microsoft.Samples.ReportingServices.AnonymousSecurity.Authorization, Microsoft.Samples.ReportingServices.AnonymousSecurity" />
- </Security>
- <Authentication>
- <Extension Name="None" Type="Microsoft.Samples.ReportingServices.AnonymousSecurity.AuthenticationExtension, Microsoft.Samples.ReportingServices.AnonymousSecurity" />
- </Authentication>
到此為止,ReportingServices2008(R2)的匿名訪問就大功告成了。
參考資料:
http://blogs.msdn.com/b/jameswu/archive/2008/07/15/anonymous-access-in-sql-rs-2008.aspx (官方教程)
http://lonely7345.cnblogs.com/ (對于AnonymousSecurity.dll有中文解釋)
原文鏈接:http://www.cnblogs.com/zhukuanglong/archive/2011/06/07/2074374.html
【編輯推薦】