Hi
We use the Crystal Report Runtime to provide Reporting functionality within our application. We have relied on a version of the Crystal Reports 2008 (12) Runtime for a number of years. However, we recently updated this to version 13.0.16.1954 (All reports have also been updated to Crystal Reports 2013 format) and have subsequently started to experience intermittent issues with reporting.
Our application is based on an Oracle database and all reports connect to it via a 32 bit ODBC Connection (CR Oracle ODBC Driver 5.3). The login credentials of the user running a report are automatically passed to the Crystal Runtime by the application. A C#.Net Windows Service is used to provide a wrapper for the Crystal Runtime and pass information to the Crystal Report Document Object from the main application. This Service is remains running in the background at all times. I've included the relevant C# source code at the bottom of this post.
Since upgrading to version 13.0.16.1954 of the Crystal Runtime we have been experiencing an intermittent issue whereby the Crystal Runtime begins to return the "Database logon failed" error. Once this error begins to be returned it is subsequently displayed for all attempts to run reports by any user until the Reporting Service has been restarted. After that action has been taken users are able to successfully run reports again. This issue can be encountered after varying periods of time ranging from minutes to days.
I have searched the forum and although I have found a number of posts referring to "Database logon failed" they do not seem to match the problem that we are experiencing. I did see a few posts on another forum relating to similar symptoms caused by a possible bug in version 13.0.12 of the Crystal Report Runtime, which was resolved by rolling back to 13.0.10 (which is no longer available).
If anybody has encountered a similar issue or has a suggestion as to the cause of the problem, any help would be greatly appreciated.
Thanks.
private void RunReport(string reportFilePath, string username, string password,
Parameter[] reportParameters, string outputFilePath, ExportOptions exportOptions)
{
ReportDocument report = new ReportDocument();
report.Load(reportFilePath, OpenReportMethod.OpenReportByTempCopy);
foreach (Table t in report.Database.Tables)
{
// Is this a "database" table (i.e. one requiring credentials)
if (!IsTableFileBased(t))
{
var conn = new ConnectionInfo();
conn.UserID = username;
conn.Password = password;
conn.ServerName = t.LogOnInfo.ConnectionInfo.ServerName;
conn.DatabaseName = t.LogOnInfo.ConnectionInfo.DatabaseName;
var logonInfo = new TableLogOnInfo();
logonInfo.ConnectionInfo = conn;
t.ApplyLogOnInfo(logonInfo);
}
}
ParameterTranslator.MigrateParameterValues(reportParameters, report);
var expOptionsCR = ExportOptionsTranslator.Translate(exportOptions);
var destOptions = CrystalDecisions.Shared.ExportOptions.CreateDiskFileDestinationOptions();
destOptions.DiskFileName = outputFilePath;
expOptionsCR.ExportDestinationOptions = destOptions;
report.Export(expOptionsCR);
}