Delphi7+水晶报表9+SQL Server2000代码类似:
Crpe1.ReportName :=aReportName;
crpe1.Connect.ServerName :=aReportServer;
crpe1.Connect.DatabaseName := aDatabaseName;
crpe1.Connect.UserID :='sa';
crpe1.Connect.Password :='apass';
crpe1.Connect.Propagate :=true;
Crpe1.Execute;但是发现数据库服务器可以动态修改,但数据库改不了,
要改变只能在水晶报表,打开其它数据库再刷新,然后再保存RPT文件才能生效.
crpe1.Connect.DatabaseName := aDatabaseName;这句话无效啊这给部署带来很大的不便,是不是我上面的写的不太对?
恳请高人指导,多谢!
Crpe1.ReportName :=aReportName;
crpe1.Connect.ServerName :=aReportServer;
crpe1.Connect.DatabaseName := aDatabaseName;
crpe1.Connect.UserID :='sa';
crpe1.Connect.Password :='apass';
crpe1.Connect.Propagate :=true;
Crpe1.Execute;但是发现数据库服务器可以动态修改,但数据库改不了,
要改变只能在水晶报表,打开其它数据库再刷新,然后再保存RPT文件才能生效.
crpe1.Connect.DatabaseName := aDatabaseName;这句话无效啊这给部署带来很大的不便,是不是我上面的写的不太对?
恳请高人指导,多谢!
to: nevergetwin(头球冲顶),怎么断啊,能说明白点么?
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;{ TableLogOnInfo log = new TableLogOnInfo();
log.ConnectionInfo.ServerName = "wudi";
log.ConnectionInfo.DatabaseName = "Mydatabase";
log.ConnectionInfo.UserID = "asp.net";
log.ConnectionInfo.Password = "exit";
ReportDocument rd = new ReportDocument();
string RptPath = null;
RptPath =Server.MapPath("CrystalReport2.rpt");
rd.Load(RptPath);
rd.Database.Tables[0].ApplyLogOnInfo(log); this.CrystalReportViewer1.ReportSource = rd; this .CrystalReportViewer1.DataBind();}
crpe1.Connect.Destroy;
crpe1.Connect.Clear;
都会导致异常出错,晕