This error message appears because the Crystal Reports for Visual Studio .NET (CR for VS .NET) engine does not have the granted permissions to the SQL Server database objects. The type of authentication method you use determines the granted permissions.The two authentication methods are:· Anonymous access· Integrated Windows authenticationAnonymous access uses the Internet Guest account by default. This account is local to the web server computer and needs to be granted permissions to the SQL Server database objects. Alternatively, you can specify a different account to be used for Anonymous access.If the Integrated Windows authentication method is used, then the NT user account logged on to the client computer will determine what permissions are granted to the CR for VS .NET engine on the Web server. All NT users that need to refresh reports will require the necessary permissions to the SQL Server database objects.If the Web server and the SQL Server are on separate computers, then there may be issues with authenticating users through IIS. Refer to the Microsoft knowledge base article Q176377 (found at http://support.microsoft.com) for more information.
解决方案 »
- 静态属性给session赋值,使用session.abandon()无法清除?
- 关于客户留言功能
- ASP.NET gRIDVIEW
- 关于vs2005中wizard控件的问题
- [求助]这样的工作可以去吗?
- 使用IMAGE控件,我想当要显示的图片宽度大于800PX时,设置为800PX
- 请问在ASPX中new Excel.Application()会报出“拒绝访问”?
- 问一下www.asp.net中同一页面地址参数不同显示不同页面的方法
- 菜鸟问题,各位老大帮忙
- 如何实现鼠标移动到textbox上,自动显示一句提示?像hpyerlink有的功能那样
- 你们谁做水晶报表成功过?我怎么一直就没有成功呢!半年了!!!专家们请进
- 誰能介紹幾個下載整個站點的工具阿﹖
如果数据库密码为空的话(我的测试是user id=sa;pwd=)可以直接使用下面代码:
CrystalReportViewer1.ReportSource = Server.MapPath("cr1.rpt");
CrystalReportViewer1.DataBind();如果数据库密码不为空的话,则应该添加以下代码安全登陆:ReportDocument Report = new ReportDocument();
Report.Load(Server.MapPath("cr1.rpt"));
TableLogOnInfo logOnInfo = new TableLogOnInfo();//对报表中的每个表进行循环
for(int i=0;i==Report.DataBase.Tables.Count-1;i++)
{
logOnInfo.ConnectionInfo.UserId = "sa";
logOnInfo.ConnectionInfo.Password = "yourpwd";
Report.DataBase.Tables[i].ApplyLogOnInfo(logOnInfo);
}
CrystalReportViewer1.ReportSource = Report;
CrystalReportViewer1.DataBind();
//当然如果密码为空的话也同样可以使用这种方法的以上代码需要
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;我试着把数据库登陆密码设为空,成功了。但是密码不为空的时候下面的代码应该写在哪里?能提供一下vb.net的代码么?