• My reports all work on the development machine using the development data.
• I do a build and install on the target machine from the code generated on the development machine.
• I do a complete data backup from the development server and restore to the target server
• The reports will not function on the target machine.
• I copy the entire Visual Studio environment to the target machine.
• I run the build exe and the report still fails.
• I open a report in Visual Studio in design mode and issue verify database. NOTE IT ASKS FOR THE SERVER NAME!
• I close the report and rebuild just that project from the solution.
• I copy the new dll to the main project and run the main exe again.
• The report now works.
My connection information for my Ole Db connection is contained in a public properties class.
It is the same connection used throughout and the application will not start without that connection.
On each form which contains the Crystal Report Viewer, for the report that is to be run, I execute the following code (the same code in both environments):
Crystal reports code goes like this and it does not work!
// Set the runtime configuration for the database for the report
private void SetDBLogonForReport(ReportDocument reportToRun)
{
CrystalDecisions.Shared.ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.IntegratedSecurity = DmsPublics.IntegratedSecurity;
connectionInfo.DatabaseName = DmsPublics.DBName;
connectionInfo.ServerName = DmsPublics.DBServer; ;
if (DmsPublics.IntegratedSecurity.ToString().ToLower().Trim() == "false")
{
connectionInfo.UserID = DmsPublics.DbUser;
connectionInfo.Password = DmsPublics.DBPassword;
}
Tables tables = reportToRun.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
{
TableLogOnInfo tableLogOnInfo = table.LogOnInfo;
tableLogOnInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogOnInfo);
}
}
• I do a build and install on the target machine from the code generated on the development machine.
• I do a complete data backup from the development server and restore to the target server
• The reports will not function on the target machine.
• I copy the entire Visual Studio environment to the target machine.
• I run the build exe and the report still fails.
• I open a report in Visual Studio in design mode and issue verify database. NOTE IT ASKS FOR THE SERVER NAME!
• I close the report and rebuild just that project from the solution.
• I copy the new dll to the main project and run the main exe again.
• The report now works.
My connection information for my Ole Db connection is contained in a public properties class.
It is the same connection used throughout and the application will not start without that connection.
On each form which contains the Crystal Report Viewer, for the report that is to be run, I execute the following code (the same code in both environments):
Crystal reports code goes like this and it does not work!
// Set the runtime configuration for the database for the report
private void SetDBLogonForReport(ReportDocument reportToRun)
{
CrystalDecisions.Shared.ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.IntegratedSecurity = DmsPublics.IntegratedSecurity;
connectionInfo.DatabaseName = DmsPublics.DBName;
connectionInfo.ServerName = DmsPublics.DBServer; ;
if (DmsPublics.IntegratedSecurity.ToString().ToLower().Trim() == "false")
{
connectionInfo.UserID = DmsPublics.DbUser;
connectionInfo.Password = DmsPublics.DBPassword;
}
Tables tables = reportToRun.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
{
TableLogOnInfo tableLogOnInfo = table.LogOnInfo;
tableLogOnInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogOnInfo);
}
}