Skip to Content
Jan 28, 2021 at 09:02 AM

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



I have been trying to eliminate the error in eg message for 20 days

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

the error comes from here on my page code behind (label1.text)


'reportdoc object

Dim cryRpt As New ReportDocument

'load report

cryRpt.Load (Server.MapPath ("~ / CrystalReport1.rpt"))

CrystalReportViewer1.ReportSource = cryRpt

Catch ex As Exception

Label1.Text = (ex.Message)

End Try

I tried all the forums all the possibilities nothing. On my computer the site works well but on my host to whom in addition paid money to have the Crystal Report option my website.

On the server, the page web does not display the CR report. I even told my host's support to copy their files to my root and I even copy it to my site but nothing works.

/ aspnet_client / system_web / 4_0_30319 / crystalreportviewers13 /

I made the call from my web.config


<add key = "UseBrowserLocale" value = "true" />

<add key = "resourceURI" value = "~/aspnet_client/system_web/4_0_30319/crystalreportviewers13" />


So what's the problem. I remind you that (My Web Server Hosting company) they have an old version of CR namely Crystal Report 13 Pack 18. I know that it just supports Framework 4.0 and no more and that you have to have a minimum of pack 23 to support more.

On my pc I uninstall my pack 28, install the pack 18 and apply the Framework to 4.0 my website. Everything works on my computer. for the CR in pack 18 I have the assemblies:


<add assembly = "CrystalDecisions.CrystalReports.Engine, Version = 13.0.2000.0, Culture = neutral, PublicKeyToken = 692fbea5521e1304" /> ... etc

So tell me what the problem is. I still have a lot of reports to complete and CR is the best in the world and the fastest. I remind you that I have been using Crystal Report for more than 20 years without a problem. Thank you for answering me.