I am working with a Crystal Reports in Vb.Net Forms application. A huge report that consists of 10-12 Sub-Reports,there are many formulas used in this report, sometimes this report shows "Object Reference not set to an instance on an object" I can't figure out, I have handled exceptions as well. When I click to "Next Page" button it shows below dialog.
Image may be NSFW.
Clik here to view.
I can't figure out why its happening. read many blogs, some says, its formula error, some says, "Mouse Move" error.
Below is the code I have added, (Vb.net)
PrivateSub CrystalReportViewer1_HandleException(ByVal source As _
Object,ByVal e As CrystalDecisions.Windows.Forms.ExceptionEventArgs) _
Handles CrystalReportViewer1.HandleException
'Label1.Text = e.Exception.ToString();
'Here I will trap.
EndSub
Below is the stack trace I have found by applying above code for exception:
Source:CrystalDecisions.CrystalReports.Engine
Message:Object reference notsetto an instance of an object.
ST: at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_IsLoaded()
at CrystalDecisions.ReportSource.NonHTTPCachedReportSource.GetReport(RequestContext context,Boolean bAddToCacheWhenCreated)
at CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext)
at CrystalDecisions.Windows.Forms.MainReportDocument.GetPage(PageRequestContext context)