Skip to Content
0

CrystalDecisions.CrystalReports.Engine.LogOnException: LogonFailed (when switched to x64-Mode)

Dec 19, 2016 at 05:28 PM

72

avatar image

exception.png

Hi my goal is to convert a Crystal Report File to PDF.

I got the Logon Error when switch to x64-Mode. This error occurs only with certain .rpt-Files. When using the "AnyOption" in debug mode everything goes well. It seems to me that the .dll has some bug when switching the compilation to x64 in Visual Studio.

The interesting thing is, i still could export the file after the exception occured which is raised by the method VerifyDatabase().

Does anyone have the same problem?

This are my codes:

ReportDocument reportDocument = new ReportDocument();
 
reportDocument.Load(@"C:\Users\lbui\AppData\Local\Temp\TestSourceFolder\ReportWithSubReportWithViewAndSP.rpt");
 
 
foreach (IConnectionInfo dataSourceConnection in reportDocument.DataSourceConnections)
{
 dataSourceConnection.SetConnection("localhost", "SomewhereDb", "UserId", "Password");
}
 
reportDocument.VerifyDatabase();
 
reportDocument.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, @"C:\Users\lbui\AppData\Local\Temp\TestSourceFolder\defcon.pdf");

Exception:

exception.png (45.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Dell Stinnett-Christy Dec 20, 2016 at 02:19 PM
0

Have you tried commenting out the call to VerifyDatabase? Unless your database is going through a lot of changes where fields are being added, removed, or changed, you don't really need to call it.

-Dell

Share
10 |10000 characters needed characters left characters exceeded