请教高手关于水晶报表WEB服务的问题?急……

liufan2005 2006-03-08 10:14:36
我在web服务项目中添加了现有的水晶报表,并将它转换为了WEB服务发布,可是在客户端WINFORM中调用时却出现了一个“数据库登陆”的对话框,服务器名称是DataSet1(只读),要求输入用户名和密码,我输入SA和密码后,还是无法连接水晶报表。怎么回事????????
...全文
160 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jeffeng 2006-04-28
  • 打赏
  • 举报
回复
我和你一样郁闷!
Jeffeng 2006-04-28
  • 打赏
  • 举报
回复
需要在显示报表前添加数据库登录信息,例如以下代码:

// Create a new instance of the tablelogoninfos class which contains
//the tablelogoninfo objects for each table in the report
crTableLogonInfos = new TableLogOnInfos();

//Create a new instance of the TableLogonInfo class which contains
//the connection information for each table
crTableLogonInfo = new TableLogOnInfo();

//Set the connection properties
//Note: this sample report connects to the SQL Server sample Pubs database
//If you have access to SQL server, enter in your values for the ServerName,
//UserID and Password properties to connect. The report included with this
//sample application connects using OLE-DB and SQL authentication.
crConnectionInfo = new ConnectionInfo();
crConnectionInfo.ServerName = "rcon1";
crConnectionInfo.DatabaseName = "Pubs";
crConnectionInfo.UserID = "vantech";
crConnectionInfo.Password = "vantech";

//apply the connection information to each table. If the TableName is not specified, the
//logon to the database will fail. Once the tablename and connection information have been
//set for each table object, it is added to the TableLogonInfos collection using the Add method.
crTableLogonInfo.ConnectionInfo = crConnectionInfo;
crTableLogonInfo.TableName = "authors";
crTableLogonInfos.Add(crTableLogonInfo);

//Pass the table information to the logoninfo property of the viewer
CrystalReportViewer1.LogOnInfo = crTableLogonInfos;

CrystalReportViewer1.ReportSource = crReportDocument;
liufan2005 2006-03-09
  • 打赏
  • 举报
回复
自己顶……

4,818

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧