Microsoft SQL SERVER 2008 R2 REPORT SERVICE 匿名登录
2013-07-17 09:38
585 查看
SQL SERVER 2008 R2 是微软目前最新的数据库版本,在之前的SQL SERVER 2005中,我们可以通过修改IIS对应的SSRS站点及SSRS的配置文件,将SSRS配置成匿名登录的方式,把报表集成到系统中,而现在SSRS2008 R2已经和IIS完全分离,所以说我们在沿用2005的配置方法是不可行的,为了让大家能够更好的了解,下面将先给大家简单介绍一下我在开发过程中,遇到的集成SSRS报表的场景。不同的集成有不同的解决方案。
1、ASP.net中集成SSRS的报表,这种集成方式,我们一般采用的方法是使用Report viewer控件展示报表,在这种情况下,如果,我们不做任何的处理,客户端在访问我们的报表时会提示window身份验证的输入框,我们只有输入用户名和密码才能正常的访问报表,在这种场景下,如果,我们想去掉windows的验证框,我们可以实现SSRS的一个接口(IReportServerCredential),该接口提供报表的三种身份验证方式(WindowsCredential、NetWorkCrendtial、FormCredential),而我们要使用的就是第二种身份验证方式。我们需要实现接口中的方法,new
NetWorkCredential(username,password,domain)然后将Report Viewer的Credential属性设置成我们实现接口类的对象,这样就间接的实现了我们的报表匿名登录。
当然,在第一种场景中,我们也可以使用SSRS的webservice,目前webservice的版本有2005、2010两个版本,直接将webservice添加引用即可(http://hostname:port/reportserver/reportservice2005.asmx或reportservice2010.asmx),这里就不详细说了。
2、第二种方式是在sharepoint中集成SSRS报表,这种方式,我们一般采用部署的方式,就可以解决SSRS访问权限的问题,我们一般采用将SSRS安装成,sharepoint集成模式的安装方式,这样SSRS就会继承sharepoint的权限管理,我们要做的就是做好sharepoint的权限控管就可以了。
3、第三种方式,也是我们今天着重要推荐的方式,是通过修改配置文件,以及添加程序集的方式,实现SSRS真正意义上的匿名登录。下面我把步骤介绍给大家。
3(1)、首先我们找到SSRS安装目录下的两个web.config配置文件,默认安装目录分别是(C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer和C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager),然后,找到两个配置文件中的
<authenticationmode="windows"/>
<identityimpersonate="true"/>
将其改为
<authenticationmode="None"/>
<identityimpersonate="false" />
3(2)、找到(C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer)目录下的rsreportserver.config文件,找到配置文件中的
<Authentication>
<AuthenticationTypes>
<RSWindowsNegotiate/>
<RSWindowsNTLM/>
</AuthenticationTypes>
<RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel><RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario><EnableAuthPersistence>true</EnableAuthPersistence></Authentication>
将其改为
<Authentication><AuthenticationTypes><Custom/></AuthenticationTypes><RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel><RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario><EnableAuthPersistence>true</EnableAuthPersistence></Authentication>
然后找到配置文件中的
<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>
将其改为
<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>
从上边两个节点中我们可以看出,我们需要引用一个dll文件,就是Microsoft.Samples.ReportingServices.AnonymousSecurity.dll,我们需要将这个dll放入到(C:\Program
Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\bin)目录下。
下载地址:http://www.zhaodll.com/dll/m/201207/164204.html
3(3)、在将dll放入到目录以后,我们来继续修改我们的配置文件,在(C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer)目录下,找到rssrvpolicy.config
找到
<CodeGroupclass="FirstMatchCodeGroup" version="1"
PermissionSetName="Nothing">
<IMembershipCondition class="AllMembershipCondition"
version="1" />
在其下边追加如下节点(红色部分,按照你的实际路径而定)
<CodeGroup
class="UnionCodeGroup" version="1" PermissionSetName="FullTrust"
Name="Private_assembly" Description="Thiscode
grou p grants customcode fulltrust.">
<IMembershipCondition class="UrlMembershipCondition"
version="1" Url="C:\ProgramFiles\Microsoft SQL
Server\MSRS10_50.MSSQLSERVER2008\ReportingServices\ReportServer\bin\Microsoft.Samples.ReportingServices.AnonymousSecurity.dll"/>
</CodeGroup>
到此为止,我们匿名登录的方式,配置工作就完成了,下面我将在配置完成后访问报表时,出现的几种错误的解决方法说明一下。
1、在访问报表时,“出现数据源访问失败,提示,数据源是windows验证,而报表服务器禁止了windows验证。或使用特定用户认证”,这种错误,很明显是你的数据源设置的验证方式不对,打开你的数据源,选择“凭证”,选择“不使用凭证”。点击确定即可。如图:
![](http://s4.sinaimg.cn/middle/7778950dt9da0c2c36c83&690&690)
注:如果你使用的数据集为Cube,在配置数据源时必须使用http的方式连接。
2、当我们修改了数据源不使用凭据后,我们需要给报表制定一个默认的执行账户,打开SSRS的配置管理,选择执行账户,设置一个系统中的账户,输入密码即可。如图:
![](http://s1.sinaimg.cn/middle/7778950dt9da0d67e13c0&690&690)
以上就是SSRS匿名登录的全部过程。
引用至:http://blog.sina.com.cn/s/blog_7778950d0100qa61.html
1、ASP.net中集成SSRS的报表,这种集成方式,我们一般采用的方法是使用Report viewer控件展示报表,在这种情况下,如果,我们不做任何的处理,客户端在访问我们的报表时会提示window身份验证的输入框,我们只有输入用户名和密码才能正常的访问报表,在这种场景下,如果,我们想去掉windows的验证框,我们可以实现SSRS的一个接口(IReportServerCredential),该接口提供报表的三种身份验证方式(WindowsCredential、NetWorkCrendtial、FormCredential),而我们要使用的就是第二种身份验证方式。我们需要实现接口中的方法,new
NetWorkCredential(username,password,domain)然后将Report Viewer的Credential属性设置成我们实现接口类的对象,这样就间接的实现了我们的报表匿名登录。
当然,在第一种场景中,我们也可以使用SSRS的webservice,目前webservice的版本有2005、2010两个版本,直接将webservice添加引用即可(http://hostname:port/reportserver/reportservice2005.asmx或reportservice2010.asmx),这里就不详细说了。
2、第二种方式是在sharepoint中集成SSRS报表,这种方式,我们一般采用部署的方式,就可以解决SSRS访问权限的问题,我们一般采用将SSRS安装成,sharepoint集成模式的安装方式,这样SSRS就会继承sharepoint的权限管理,我们要做的就是做好sharepoint的权限控管就可以了。
3、第三种方式,也是我们今天着重要推荐的方式,是通过修改配置文件,以及添加程序集的方式,实现SSRS真正意义上的匿名登录。下面我把步骤介绍给大家。
3(1)、首先我们找到SSRS安装目录下的两个web.config配置文件,默认安装目录分别是(C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer和C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager),然后,找到两个配置文件中的
<authenticationmode="windows"/>
<identityimpersonate="true"/>
将其改为
<authenticationmode="None"/>
<identityimpersonate="false" />
3(2)、找到(C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer)目录下的rsreportserver.config文件,找到配置文件中的
<Authentication>
<AuthenticationTypes>
<RSWindowsNegotiate/>
<RSWindowsNTLM/>
</AuthenticationTypes>
<RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel><RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario><EnableAuthPersistence>true</EnableAuthPersistence></Authentication>
将其改为
<Authentication><AuthenticationTypes><Custom/></AuthenticationTypes><RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel><RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario><EnableAuthPersistence>true</EnableAuthPersistence></Authentication>
然后找到配置文件中的
<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>
将其改为
<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>
从上边两个节点中我们可以看出,我们需要引用一个dll文件,就是Microsoft.Samples.ReportingServices.AnonymousSecurity.dll,我们需要将这个dll放入到(C:\Program
Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\bin)目录下。
下载地址:http://www.zhaodll.com/dll/m/201207/164204.html
3(3)、在将dll放入到目录以后,我们来继续修改我们的配置文件,在(C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer)目录下,找到rssrvpolicy.config
找到
<CodeGroupclass="FirstMatchCodeGroup" version="1"
PermissionSetName="Nothing">
<IMembershipCondition class="AllMembershipCondition"
version="1" />
在其下边追加如下节点(红色部分,按照你的实际路径而定)
<CodeGroup
class="UnionCodeGroup" version="1" PermissionSetName="FullTrust"
Name="Private_assembly" Description="Thiscode
grou p grants customcode fulltrust.">
<IMembershipCondition class="UrlMembershipCondition"
version="1" Url="C:\ProgramFiles\Microsoft SQL
Server\MSRS10_50.MSSQLSERVER2008\ReportingServices\ReportServer\bin\Microsoft.Samples.ReportingServices.AnonymousSecurity.dll"/>
</CodeGroup>
到此为止,我们匿名登录的方式,配置工作就完成了,下面我将在配置完成后访问报表时,出现的几种错误的解决方法说明一下。
1、在访问报表时,“出现数据源访问失败,提示,数据源是windows验证,而报表服务器禁止了windows验证。或使用特定用户认证”,这种错误,很明显是你的数据源设置的验证方式不对,打开你的数据源,选择“凭证”,选择“不使用凭证”。点击确定即可。如图:
注:如果你使用的数据集为Cube,在配置数据源时必须使用http的方式连接。
2、当我们修改了数据源不使用凭据后,我们需要给报表制定一个默认的执行账户,打开SSRS的配置管理,选择执行账户,设置一个系统中的账户,输入密码即可。如图:
以上就是SSRS匿名登录的全部过程。
引用至:http://blog.sina.com.cn/s/blog_7778950d0100qa61.html
相关文章推荐
- Microsoft SQL SERVER 2008 R2 REPORT SERVICE 匿名登录--zt
- Microsoft SQL SERVER 2008 R2 REPORT SERVICE 匿名登录
- Microsoft SQL SERVER 2008 R2 REPORT SERVICE 匿名登录
- Microsoft SQL SERVER 2008 R2 REPORT SERVICE 匿名登录
- Microsoft SQL SERVER 2008 R2 REPORT SERVICE 匿名登录
- Microsoft SQL SERVER 2008 R2 REPORT SERVICE 匿名登录
- Microsoft SQL SERVER 2008 R2 REPORT SERVICE 匿名登录(转)
- Microsoft SQL SERVER 2008 R2 REPORT SERVICE 匿名登录
- 解决Sqlserver 2008 R2在创建登录名出错"此版本的 Microsoft Windows 不支持 MUST_CHANGE 选项。 (Microsoft SQL Server,错误: 15195)"
- SSIS将Excel文件批量导入到Microsoft SQL Server 2008 R2
- 数据库备份和恢复秩序的关系(周围环境:Microsoft SQL Server 2008 R2)
- 卸载Microsoft SQL Server 2008 R2 安装程序
- Microsoft® SQL Server® 2008 R2 Service Pack 1正式版
- Microsoft SQL Server 2008 R2 RTM - Management Studio Express在Windows7的安装
- Microsoft SQL Server 2008 R2 安装卸载
- 关于sql server 2008 r2 展开时报错:参数名:viewInfo ( Microsoft SqlServer Management SqlStudio Explorer )解决思路
- Microsoft Sql Server 2008 R2 Express 下载地址推荐
- DBCC大全集之(适用版本MS SQLServer 2008 R2)----DBCC INPUTBUFFER显示从客户端发送到 Microsoft SQL Server 实例的最后一个语句
- Microsoft SQL Server 2008 R2 Enterprise安装指南
- Microsoft SQL Server 2008 R2 XML处理 One solution is to increase the number of characters retrieved from the server for XML data.