Problem with error handling in DevExpress XtraReport
ScottBeard
Posts: 3
HI, I'm evaluating SA at the moment. I'm using SA on my c# library and c# app. The library is being used to display a DevExpress XtraReport.
There is an exception (NullReferenceException) being raised in one of the report events. If I wrap my event code in try/catch then it's caught ok and I can deal with it. However if I don't do this SA doesn't catch the exception - the XtraReport just displays a simple message box.
For an additional problem, if I try/catch my code then call ExceptionReporting.Report to use the SA handler then it actually gets even worse - the SA error handling window does appear, but underneath it there's a modal message saying "Stack empty". Took me a minute or two to figure that out, as it looks like the app has locked up!
There is an exception (NullReferenceException) being raised in one of the report events. If I wrap my event code in try/catch then it's caught ok and I can deal with it. However if I don't do this SA doesn't catch the exception - the XtraReport just displays a simple message box.
For an additional problem, if I try/catch my code then call ExceptionReporting.Report to use the SA handler then it actually gets even worse - the SA error handling window does appear, but underneath it there's a modal message saying "Stack empty". Took me a minute or two to figure that out, as it looks like the app has locked up!
Comments
Are you able to create a minimalistic project that exhibits this behaviour so that I can reproduce here? This dramatically speeds up the resolution prognosis.
If not, I'll probably have to reproduce anyway so it might take a little while...
* I created a very basic report, linked to a simple xpcollection.
* I added a grouping level and a field from the bound xpcollection to the grouping footer.
* Added an event to the summary calculation event (can't remember the exact event name)
* In the event code I had some buggy code which generated a null exception error - there wasn't anything fancy going on - you could just declare a null string and query it's properties to get the same effect.
Thanks.
To get around the issue I [DoNotObfuscate] the XtraReport designer namespace for each report.
I'll create a small project in the next few days and let you have it if the OP didn't send you one.