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

@Ludek:; if problem cannot be reproduced by your dev's team we did give you alot of information where and how this error pop-up.

Its on loading report, before report show there is message saying something "procesing..." and then we got specific error "onMouseMove". I dont think you have many events on mouseMove.

I cannot reproduce it at my wokr eather and its becouse our computer are much faster than custumores one and that loading screen is very short almoust instantly while at customers that "processing" message somethines can be few sec long.

Former Member
0 Likes

Understood. But I can get the a long report load time duplicated on skookum fast machine by simply running a complicated report. Say one that has a 1,000 + formulas. And no crash...

You your self say that you can not reproduce it. So yes, we have been given a lot of info on how to and I appreciate that, but if you can not repro it, I'm not sure what we should be doing(?). I'll take any ideas - other than; go get a really old slow box :).

I have a feeling that this will boil down to video drivers, video resolution, mouse drivers, some other drivers (printer?) and or combination there off.

Ludek

Edited by: Ludek Uher on Jan 14, 2011 7:40 AM

ido_millet
Active Contributor
0 Likes

Hi Ludek,

Since you opened the door (requesting ideas), there is a clear unhandled exception in a clearly identified internal event. Ask the development team to catch and quietly handle that exception.

My guess is that they are using an event argument to instantiate an object that has not yet materialized. The detail is not that important. What's important is that ANY "Developer" worth that title should be able to resolve this bug within 1 hour of work.

Former Member
0 Likes

Exactly !

Solving this problem with your developers wont be much of a problem, we can catch excaption too and silently ignore it but its not way that should be done. In all forms i have viewer to code error exception that will be, probably, solved is not solution i am looking forward.

This is really frustrating and if we can get info will this be fixed soon or not. If it wont be in near future i will have to handle it in my application and all other users will have to do the same. (dont you think its something wrong with that solution?)

Former Member
0 Likes

How would you catch this exception? The control is throwing it outside of my user code... I've put my try statements around CRViewer.ReportSource = "..." but that doesn't catch the exception. Just curious how you would handle this.

Former Member
0 Likes

A quick update. I just installed CR 2010 for VS2010 for the first time, built a simple viewer, and ran a report. The first time it ran perfectly, the second time it gave the onMouseMove error we've been discussing.

One thing seems to cause the exception to get thrown more often. On the parameter screen, if you click around a lot, highlight some stuff, and be aggresive with the mouse, then press OK, the exception generally gets thrown.

Former Member
0 Likes

Well i didnt try it yout but i would do all block that load report do in try and catch nullReferenceExcetion, in catch block i would check if my exceltion.StackTrace contains "CrystalDecisions.Windows.Forms.PageControl.OnMouseMove" and just ignore it.

in c# somoething like this:

try {

loading reports code here.

}

catch (NullReferenceException ex)

{

if (! ex.StackTrace.Contains("CrystalDecisions.Windows.Forms.PageControl.OnMouseMove"))

{

throw ex;

}

}

I didnt try it yet since i am waiting for SAP Comunity to answer about fixing this soon or not.

It is not that simple for me to implement it, i need to make new version and autoupdate all my clinets so if you can try it and see if it works would be nice

former_member208657
Active Contributor
0 Likes

Unfortunately "soon" isn't in our vocabulary. Our fix process is quite complex so it takes a while to get things fixed and out the door. The pipe has been closed on fixes going into SP1, so IF this was to be fixed (note the IF) it would be in SP2.

And to answer your next question, we haven't announced release dates for SP1 or SP2 yet.

Former Member
0 Likes

Ok, thank you for letting us know.

Former Member
0 Likes

Hi:

We are experiencing exactly the same problem.

Just one thing. It seems related to large multiline text fields in the report. If the fields contains 50 chars, usually the error is no generated, when the field contains more than 250 chars usually the error is generated. Error only preview, works fine printing and sending to pdf.

Now working with VS 2010, VB.NET, Windows App (tried in 32 bits and 64 bits environments). The error doesn't seems related to the operating system (reproduced in Windows XP, 2003, vista and 7). Nver used the beta version, just final release.

Any workaround from SAP will be apreciated.