Skip to Content
0
Oct 21, 2020 at 05:54 PM

The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.

1058 Views Last edit Oct 22, 2020 at 03:40 PM 3 rev

Hi Team,

I am trying to load the crystal report from my code using :

Dim rptDoc = New ReportDocument

With rptDoc .Load(sCrystalReport) .RecordSelectionFormula = sSelectionFormula End With

Crystal report runtime engine for .NET Framework 32 bit and 64 bit is installed on my machine.It was working till June but now its stopped working.

I am getting below exception:

The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. StackTrace Information ********************************************* at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor() at FVC.CDAReportExportPF.ExportCrystalReportPDF(String sCrystalReport, String sSelectionFormula, String sFileName) at FVC.CDAReportExportPF.Run() Properties ********************************************* Type: System.TypeInitializationException TypeName: CrystalDecisions.CrystalReports.Engine.ReportDocument TargetSite: Void .ctor() Source: CrystalDecisions.CrystalReports.Engine HResult: -2146233036 Inner Exception #1 ********************************************* Retrieving the COM class factory for component with CLSID {059AC10F-0010-4C43-8876-1FC7BEAF218B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). StackTrace Information ********************************************* at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() Properties ********************************************* Type: System.Runtime.InteropServices.COMException ErrorCode: -2147221164 TargetSite: Void .cctor() Source: CrystalDecisions.CrystalReports.Engine HResult: -2147221164