hi
This is kavita. currently I m working on crystal report in c# with ASP.NET,
I want to ask when we generate crystal report (coose project->....) we give server name database name,select table ,grouping etc.
but if we want to change our system then how to change server name.
Loading
sanjeet kumarPosted Dec 8, 2006, 4:12 AM
SampleReport testReport=new SampleReport(); //object of the report fileprotected
TableLogOnInfo crTableLogOnInfo =
new TableLogOnInfo();ConnectionInfo crConnectionInfo =
new ConnectionInfo();CrystalDecisions.CrystalReports.Engine.Database crDatabase;
CrystalDecisions.CrystalReports.Engine.Tables crTables;private void Page_Load(object sender, System.EventArgs e)
{
crConnectionInfo.ServerName = "localHost";
// or Ip address of the machine on which the programme is loaded
crConnectionInfo.DatabaseName = "TestDatabase"; //database name
crConnectionInfo.UserID = "sa";
crConnectionInfo.Password = "";
crDatabase = testReport.Database;
crTables = crDatabase.Tables;
foreach(CrystalDecisions.CrystalReports.Engine.Table crTable in crTables){
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
}
}
/* I hope this code will solve your problem*/