We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Creating RDLC Reports in Report Designer throws NullReferenceException

Thread ID:

Created:

Updated:

Platform:

Replies:

116132 Apr 9,2014 12:01 PM Apr 11,2014 01:33 AM WPF 2
loading
Tags: ReportDesigner
System Administrator
Asked On April 9, 2014 12:01 PM

Hi,

I am following the instructions on http://help.syncfusion.com/ug/wpf/report%20designer/documents/creatingrdlcreportsi.htm to use objects as a data source.

Very little code is used but i have MainWindow.xaml.cs

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            Designer.DesignMode = DesignMode.RDLC;
            Designer.Assemblies = new List<Assembly>();
            Designer.Assemblies.Add(Assembly.GetExecutingAssembly());
        }
....

And MainWindow.Xaml
....
    <Grid>
        <Grid>
            <syncfusion:ReportDesigner x:Name="Designer" />
        </Grid>
    </Grid>
</Window>

And DataStore.cs which has the code pasted from the help topic.

When i run the builder and create a new data set as per the instructions it works fine until i try step 8 'Click Run to preview the report in the designer.'
When i click Run i get a System.NullReferenceException {"Object reference not set to an instance of an object."}

I can't seem to get it to work! If i do not have a datasource which references an object then it will not throw an exception. I have tried including every DLL in case its a reference problem.

StackTrace:
   at Syncfusion.RDL.DOM.ConnectionProperties..ctor(ConnectionProperties connectionProperties)
   at Syncfusion.RDL.DOM.DataSource.Update(DataSource datasource)
   at Syncfusion.RDL.DOM.DataSource.Clone()
   at Syncfusion.Windows.Reports.Designer.ReportDesignView.OpenViewer()
   at Syncfusion.Windows.Reports.Designer.ReportDesigner.ViewReportViewer()
   at Syncfusion.Windows.Reports.Designer.ReportDesigner.Btn_ViewReport_Click(Object sender, RoutedEventArgs e)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at Syncfusion.Windows.Tools.Controls.RibbonButton.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   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)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at WpfApplication1.App.Main() in d:\2014-04-9 - Developer Days 2\WpfReportDesigner\WpfApplication1\WpfApplication1\obj\Debug\App.g.cs:line 0
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Is there a working example of this somewhere?

System Administrator
Replied On April 9, 2014 12:11 PM

Just to add a final comment (I can't seem to edit a post) I was looking at other posts by users (http://www.syncfusion.com/support/forums/wpf/reportdesigner/115630) and the source provided for one of the solutions has this exact same problem. I am using Visual Studio 2013 and have tried various framework versions.



Anandakumar S [Syncfusion]
Replied On April 11, 2014 01:33 AM

Hi LEO LI,

We are able to reproduce the reported issue , in order for you to get a solution for this behavior, please contact us at Syncfusion Support or you may also open a support ticket by login in to direct trac account and mention this forum link for reference.

Regards,

Anandakumar S


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;