cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member726498
Discoverer
0 Kudos

Hi,

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)

Try

'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

<crystalReportViewer>

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

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

</crystalReportViewer>

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.

https://answers.sap.com/questions/565393/net-framework-472-update-breaks-crystal-reports-wi.html

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

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:

<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.

Adam.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Adam,

The problem is the hosting site needs to update the runtime to SP 29.

For those other projects that have not updated they need to use the Redirect command to tell it use the SP 18 equivolent.

See this KBA on how it works:

2719939 - Crystal Reports for Visual Studio Runtime versioning - side by side ability - what to do with WinFormCRViewer.zip from download WIKI

FYI - we only support the latest SP

Don

former_member726498
Discoverer
0 Kudos

Hi,

Thank you for your answers and I totally agree with you. I am using Visual Studio 2019 Pro 32bit in my developpement machine (which requires a minimum of CR 13 SP 25). Service pack 29 would be perfect for me. I have already sent your answers to my hosting website and I am waiting.

I wonder why SAP has not opted for hosting solutions because really on Azure it is also quite long to configure SAP CR or even impossible in some cases (my hosting webs are not Azure. I like Azure. But In Azure you should use Azure VM or cloud service to do that which is quite abnormal. (if you have answers on Azure or a configuration link that would be perfect. because I plan to have some).

I tested version 28 on a server pc at home with Windows Server 2016. it works perfectly with all frameworks. Thank you for your response.

Adam.

Answers (1)

Answers (1)

DellSC
Active Contributor
0 Kudos

In the version number you posted - 13.0.2000.0 - the "2000" means that it requires .NET 2.0.

-Dell