cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

I'm building a windows form app using vb.net, Visual Studio 2008, and CR 2008 (12.0.2000.0). I have a very simple app that loads a report into a viewer control when the form is loaded. About 80% of the time, the report loads with no issue. The other 20% of the time, I receive an exception which Visual Studio doesn't point out where in my code it is, so I'm assuming its the CR viewer that is throwing it. Here is the code I am using, and the associated exception is below. I can't for the life of me figure this out, and the issue has been replicated on a clean system running the CR 2008 SP3 Runtime. Any advice would be GREATLY appreciated.

VB Code:

-


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim Report As CrystalDecisions.CrystalReports.Engine.ReportDocument

Report.Load("c:\report.rpt")

crystalreportviewer_main.ReportSource = Report

End Sub

-


Exception:

-


System.NullReferenceException was unhandled

Message="Object reference not set to an instance of an object."

Source="CrystalDecisions.Windows.Forms"

StackTrace: 3

at CrystalDecisions.Windows.Forms.PageControl.OnMouseMove(MouseEventArgs e)

at System.Windows.Forms.Control.WmMouseMove(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ContainerControl.WndProc(Message& m)

at System.Windows.Forms.UserControl.WndProc(Message& m)

at CrystalDecisions.Windows.Forms.PageControl.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

at System.Windows.Forms.Application.Run(ApplicationContext context)

at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()

at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()

at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)

at Rock_Pond_Solutions.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81

at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)

at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()

InnerException:

-


Edited by: mlager on Oct 20, 2010 12:41 AM

Edited by: mlager on Oct 20, 2010 12:44 AM

0 Likes
View Entire Topic
Former Member
0 Likes

When will SAP get this Crystal reports problem get fixed?

The threads below all describe workarounds:-

This intermittent and rare error occurs within the OnMoveMove method of the Crystal Reports Viewer component.

SAP/Crystal Reports cannot reproduce the issue and have not fixed it - see following web links :

.

/*** 03-Mar-11 17:47 (STS) : Problem Log Edited ; ***/

The following article suggests its to do with the "dock" property of the viewer being set to "fill" :

http://social.msdn.microsoft.com/Forums/en/vscrystalreports/thread/98bb4330-e3e5-46e2-abbb-76c730ddd...

We have a mature product that has used the Crystal report Viewer without serious ERRORs until now.

When we upgraded to .Net Framework 4 and VS2010 we get this problem when viewing reports with many pages or smaller reports with "Can Grow" table cells.

As no fix appears to be available we are consirdering rendering the reports to PDF and using an ADOBE viewer to view them.

Edited by: David Smith on Mar 17, 2011 11:00 AM

Former Member
0 Likes

Note that on Mar 10, 2011 I posted the number of a Technical Escalation. Once that is done, the earliest fix would be in the next Service Pack (SP 2). ETA: July+(?)

Also, in the same post I offered to have a look at any "Saved Data" report that reproduces the issue as a relatively simple adjustment may resolve \ work-around the issue as it did with Keith.

My plea for report examples has so far not been answered. While two posters offered to share their reports, and I emailed both of them and I never got a reply. If you seriously want to share the report with me so I can have a look, let me know I will contact you over email. Else, July - though no promises...

- Ludek

Former Member
0 Likes

Hi David

It sounds like you are having the exact same problem as I had, I looked everywhere for a solution and couldnt find one. I also saw the Dock property posting but that didnt fix my report. I wrote a sample app and sent to Ludek to re-create the exception using .Net4 framework. I upgraded from VS2005 through 2008 then to 2010 but only started getting the problem with 2010.

I strongly believe that if you export a report through the crystal report viewer to a *.rpt file and send it to Ludek he may have a workaround. It did work for me, I had dozens of reports that threw this exception in a release environment and got extremely frustrated with it which is why I raised the phone support case. When I followed the instructions for workaround it took me about an hour to fix the reports and I dont get the exception anymore. Users of my software are now happy

Anybody who has this problem, please export the report to file through the crystal report viewer (*.rpt saves data) and lets see if we can flush this little monster out!

Keith

Edited by: KDHarrison on Mar 17, 2011 9:12 PM

mlager, not sure if your still watching this thread, do you still get this exception?