本帖最后由 wn_www 于 2017-8-11 16:36 编辑
您好! 我将Spread winforms V10 封装到WindowsFormsHost中,再将其用于WPF工程中,遇到如下问题:
1 Spread Winforms V10 图表的右键菜单(Select Data..)不弹配置数据源对话框, 点击(Select Data..)后再选单元格,抛异常,但其他的菜单项工作是正常的:
System.Exception was unhandled
HResult=-2146233088
Message=Exception handled in FpSpread.WndProc
Source=FarPoint.Win.Spread
StackTrace:
at FarPoint.Win.Spread.FpSpread.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 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at WpfApplicationWithSpreadWinformsV10.App.Main() in e:\wn\Program\wpf\TT\WpfApplication1\WpfApplicationWithSpreadWinformsV10\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly 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.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()
InnerException: System.NullReferenceException
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=FarPoint.Win.Spread
StackTrace:
at FarPoint.Win.Spread.Chart.ChartSelectDataSource.UpdateSelectionCellRange(SheetView sheetView, CellRange[] allSelectedCellRanges)
at FarPoint.Win.Spread.ModelessForm.OnSelectionChanging(CellRange cellRange, CellRange[] allSelectedCellRanges)
at FarPoint.Win.Spread.ModelessForm.a(Object A_0, SelectionChangingEventArgs A_1)
at FarPoint.Win.Spread.FpSpread.OnSelectionChanging(SelectionChangingEventArgs e)
at FarPoint.Win.Spread.FpSpread.a(SpreadView A_0, CellRange A_1, Int32 A_2, Int32 A_3)
at FarPoint.Win.Spread.SpreadView.ContinueCellSelecting(Int32 x, Int32 y)
at FarPoint.Win.Spread.SpreadView.h(MouseEventArgs A_0)
at FarPoint.Win.Spread.FpSpread.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at FarPoint.Win.Spread.FpSpread.WndProc(Message& m)
InnerException:
2 Spread Winforms V10 打不开office2007/2013 版本的带图表的EXCEL,抛异常:
System.InvalidOperationException was unhandled
HResult=-2146233079
Message=<chartSpace xmlns='http://schemas.openxmlformats.org/drawingml/2006/chart'> was not expected.
Source=Microsoft.GeneratedCode
StackTrace:
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCT_ChartSpace.Read240_chartSpace()
InnerException:
测试工程:
请见附件。
|
|