I am getting the following exception when my view first loads. I have default parameters set for the report and am using IEnumerable ObjectsSource.
Object reference not set to an instance of an object.
at Infragistics.Controls.Reports.XamReportViewer.CheckForReportParameters(Boolean reset)
at Infragistics.Controls.Reports.ViewerStateMachine.Render(Boolean firstRender, IDictionary`2 selectedParameterValues)
at Infragistics.Controls.Reports.ViewerStateMachine.ApplyAutoRender()
at Infragistics.Controls.Reports.ViewerStateMachine.set_IsVisualReady(Boolean value)
at Infragistics.Controls.Reports.XamReportViewer.ReportViewerLoaded(Object sender, RoutedEventArgs e)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
The report renders when the submit button is clicked on the parameters tab. The parameters are not held when the user takes the focus off of the report viewer to another view. I cant find a way to bind the parameters to stop this from happening.
Thanks,
Eric Larson
Hi,
AFAIK you can't avoid that the Tab Control unloads the viewer when you switch tabs. So you will have to use the viewer outside the control until the bug is fixed (V1).
Leo
Could you explain how to prevent the XamReportViewer from unloading? I'm struggling with this exception too.
Thank you for the information. I look forward to seeing it fixed. So far I am enjoying the product.
Hi Eric,
Sorry for the delay.
It is a bug. Currently the XamReportViewer reset its state when the control is unloaded, so each time you are switching tabs a reset occurs. This issue will be fixed for V1.
Currently the only workaround would be to prevent the XamReportViewer from being unloaded.
Is there any update on this or fixes?