一步一步实现ReportingServices2008匿名访问

在ReportingServices2005中我们需要匿名访问报表的时候,只需要在IIS里面做下简单设置就可以实现,而在ReportingServices2008(R2)中不在依靠IIS,只是占用的还是80端口而已。其实匿名访问有很多中解决办法,譬如:使用ReportViewer控件、与SharePoint集成等等......

下面我介绍SQL团队技术博客所提供的比较彻底而且通用的方法 。(注:修改配置文件前如果害怕出问题请提前备份)

第一步:编译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文件,替换二者中的节点,将

 
 
 
  1. <authentication mode="Windows" />  
  2. <identity impersonate="true"/> 

替换为

 
 
 
  1. <authentication mode="None" />  
  2. <identity impersonate="false"/>  

第三步:修改*:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer修改rereportserver.config把

 
 
 
  1. <Authentication>  
  2.    <AuthenticationTypes>  
  3.     <RSWindowsNegotiate/>  
  4.     <RSWindowsNTLM/>  
  5.    </AuthenticationTypes>  
  6. <EnableAuthPersistence>true</EnableAuthPersistence>  
  7. </Authentication> 

修改为

 
 
 
  1. <Authentication>  
  2.    <AuthenticationTypes>  
  3.     <Custom/>  
  4.    </AuthenticationTypes>  
  5. <EnableAuthPersistence>true</EnableAuthPersistence>  
  6. </Authentication> 

第四步:修改*:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer修改rereportserver.config在

 
 
 
  1. <Security>  
  2.  <Extension Name="Windows" Type="Microsoft.ReportingServices.Authorization.WindowsAuthorization, Microsoft.ReportingServices.Authorization"/>  
  3. </Security>  
  4. <Authentication>  
  5.  <Extension Name="Windows" Type="Microsoft.ReportingServices.Authentication.WindowsAuthentication, Microsoft.ReportingServices.Authorization"/>  
  6. </Authentication> 

节点下,添加

 
 
 
  1. <Security>  
  2.        <Extension Name="None" Type="Microsoft.Samples.ReportingServices.AnonymousSecurity.Authorization, Microsoft.Samples.ReportingServices.AnonymousSecurity" />  
  3. </Security>  
  4. <Authentication>  
  5.        <Extension Name="None" Type="Microsoft.Samples.ReportingServices.AnonymousSecurity.AuthenticationExtension, Microsoft.Samples.ReportingServices.AnonymousSecurity" />  
  6. </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

 

【编辑推荐】

 

  1. 淘宝海量数据库之克服随机IO难题
  2. 数据库如何抵抗随机IO的问题、方法与现实
  3. 一步一步设计你的数据库之不可轻视的需求分析
  4. 养成一个SQL好习惯带来一笔大财富
  5. 怎样获取某个数据库的所有存储过程SQL语句
THE END