Hello, I am recieving an exception when trying to export my datapresenter (XamDataGrid) as an Excel file. The error is below.
I have my own FieldLayout class so that I can convert my serialized data easily to a FieldLayout. I also have my own class that bases from Field and it also does the deserialization to a Field for me. These two classes both have a default, parameterless constructor defined. The grid works as expected at runtime when using these two classes as the FieldLayouts and the Fields. How do I track down this error? Has anyone ran into this issue before? This happens when using the DataPresenterExcelExporter and the Infragistics.Windows.Reporting.Report by calling the Print method.No parameterless constructor defined for this object.
Stack Trace at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at Infragistics.Windows.CloneManager.Clone(MarkupObject mo, CloneInfo cloneInfo) at Infragistics.Windows.DataPresenter.DataPresenterExportControlBase.ExportCloneManager.Clone(MarkupObject mo, CloneInfo cloneInfo) at Infragistics.Windows.CloneManager.CloneItems(Object clone, MarkupProperty mp, CloneInfo cloneInfo) at Infragistics.Windows.CloneManager.Clone(MarkupObject mo, CloneInfo cloneInfo) at Infragistics.Windows.DataPresenter.DataPresenterExportControlBase.ExportCloneManager.Clone(MarkupObject mo, CloneInfo cloneInfo) at Infragistics.Windows.CloneManager.Clone(Object source) at Infragistics.Windows.DataPresenter.DataPresenterExportControlBase.CloneHelper(Object source, Boolean copyNonSerializableProperties) at Infragistics.Windows.DataPresenter.DataPresenterExportControlBase.CloneSourceDataPresenter(ReportSection section, IExportOptions options) at Infragistics.Windows.DataPresenter.ExportHelper.InitializeExportControl(DataPresenterExportControl exportControl, IExportOptions options) at Infragistics.Windows.DataPresenter.ExportHelper.Export(IDataPresenterExporter exporter, IExportOptions options) at Infragistics.Windows.DataPresenter.DataPresenterBase.Export(IDataPresenterExporter exporter, IExportOptions options) at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporter.Export(DataPresenterBase dataPresenter, Worksheet worksheet, Int32 startRow, Int32 startColumn, ExportOptions options, String filename) at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporter.Export(DataPresenterBase dataPresenter, WorkbookFormat workbookFormat, ExportOptions options, String filename) at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporter.Export(DataPresenterBase dataPresenter, String fileName, WorkbookFormat workbookFormat, ExportOptions options) at Hyland.Canvas.Controls.WorkView.WorkViewFilterControlViewModel.ExportToExcelCommandExecuted() in D:\Core__Int\Core\OnBase.NET\Libraries\Hyland.Canvas.Controls\WorkView\FilterControl\WorkViewFilterControlViewModel.cs:line 338 at Hyland.Canvas.DelegateCommand.<>c__DisplayClass8.<.ctor>b__5(Object o) in D:\Core__Int\Core\OnBase.NET\Libraries\Hyland.Canvas\DelegateCommand.cs:line 25 at Hyland.Canvas.DelegateCommand`1.Execute(Object parameter) in D:\Core__Int\Core\OnBase.NET\Libraries\Hyland.Canvas\DelegateCommand.cs:line 71 at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated) at MS.Internal.Commands.CommandHelpers.ExecuteCommandSource(ICommandSource commandSource) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at Infragistics.Windows.Ribbon.ButtonTool.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.EventRoute.ReInvokeHandlers(Object source, RoutedEventArgs args) at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e) at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.EventRoute.InvokeHandlers(Object source, RoutedEventArgs args) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) 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)
I had a typo somewhere with an access modifier and set it to private. It was because I had a static method newing up the object. This was my fault.
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.