cancel
Showing results for 
Search instead for 
Did you mean: 

Error while loading crystal report

Former Member
0 Kudos

I get the following error while opening a report.

Also please note that, i have already installed the cr runtime environment (version 13) in the target machine.

System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.

   at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()

Kindly help

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Please Try searching first, this has been posted 100's of times, likely you have your project set to AnyCPU and the OS is 64 bit so MSIExec detected it an installed the 64 bit runtime. Your project is likely meant to run in x86 mode.

CR Redist packages are set for your project platform and not the OS platform.

Don

Former Member
0 Kudos

Thanks Sir,

Sorry.

Former Member
0 Kudos

I have passed the login information for the crystal report through code, which is put below. But when i install the software in a client machine and try to open it, the login is again asked.

The following code is used for internal login.

CReport.SimpleCrystalReportViewer simple = new CReport.SimpleCrystalReportViewer(); //
  simple
.Show();
  
CReport.EmployeeVisaDetail report = new CReport.EmployeeVisaDetail();
  
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
  
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
  
ConnectionInfo crConnectionInfo = new ConnectionInfo();
  
Tables CrTables;
  report
.Load();
  crConnectionInfo
.ServerName = db.ServerName;
  crConnectionInfo
.DatabaseName = db.DataBase;
  crConnectionInfo
.UserID = db.UserName;
  crConnectionInfo
.Password =  db.Password;

  
CrTables = report.Database.Tables;
  
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
  
{
  crtableLogoninfo
= CrTable.LogOnInfo;
  crtableLogoninfo
.ConnectionInfo = crConnectionInfo;
  
CrTable.ApplyLogOnInfo(crtableLogoninfo);
  
}



  simple
.crystalReportViewer1.ReportSource = report;
  simple
.crystalReportViewer1.RefreshReport();

  simple
.crystalReportViewer1.Zoom(1);

0 Kudos

Missing and grayed out info boxes indicate the application can't find the Database client.

Make sure it's the same version as you are using and is 32 or 64 bit as your application is set to.

Don

Answers (0)