Skip to Content
0

Why does get_IsLoaded() throw exception "Object reference not set to an instance of an object"?

Aug 30, 2017 at 04:32 PM

97

avatar image
Former Member

Hello,

I'm using Crystal Reports 11 with .net and recently in a production environment the following exception started to happen sometimes with ReportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat):

Message: Object reference not set to an instance of an object.
Source: CrystalDecisions.CrystalReports.Engine
TargetSite: Boolean get_IsLoaded()
StackTrace:    em CrystalDecisions.CrystalReports.Engine.ReportDocument.get_IsLoaded()
   em CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport()
   em CrystalDecisions.CrystalReports.Engine.ReportDocument.get_FormatEngine()
   em CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options)
   em CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType)
   em Hotel_WebUI.PrintFunctions.ProcessMasterPDF2(List`1 doclist)
   em Hotel_WebUI.PrintFunctions.PrintDocument(Boolean bAddHeader, Int32 iLocalCurrencyCopies, Int32 iForeignCurrencyCopies, Boolean isOriginal)

This doesn't happen all the time and I can't provoke it in my test environment.

I couldn't find anything in the Internet about this stackTrace.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Don Williams
Aug 30, 2017 at 10:01 PM
0

11.5 is end of life and end of support and never tested on anything higher than Windows 2008, no idea what may be causing the issue now. Too many security and other changes made by MS to determine what the issue may be.

If you are using VS 2010 -> 2015 and soon 2017 then use the updated CR .NET SDK for all versions after CR 2008 from here:

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

SP 21 should be out soon and will support VS 2017 and no dependency on VC 2005 C++ runtime.

Don

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Aug 30, 2017 at 04:34 PM
0

That error simply means the report you attempted to load or use in code was not available, it's gone out of scope.

What SDK are you using?

Don

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

I'm developing with .NET c# webforms in Visual Studio referecing the dlls for CrystalDecisions.CrystalReports.Engine, CrystalDecisions.ReportSource, CrystalDecisions.Shared and CrystalDecisions.Web of Crystal Reports 11.5.3700.0

0