C# winform 打印Excel

OfficeOpenXml.LicenseException
  HResult=0x80131500
  Message=Please set the ExcelPackage.LicenseContext property. See https://epplussoftware.com/developers/licenseexception
  Source=EPPlus
  StackTrace:
   at OfficeOpenXml.ExcelPackage.get_Workbook()
   at MangZhuan.Forms.FormException.printDocument1_PrintPage(Object sender, PrintPageEventArgs e) in E:\vsproject\MangZhuan\MangZhuan\Forms\FormException.cs:line 166
   at System.Drawing.Printing.PrintDocument.OnPrintPage(PrintPageEventArgs e)
   at System.Drawing.Printing.PrintDocument._OnPrintPage(PrintPageEventArgs e)
   at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document)
   at System.Drawing.Printing.PrintController.Print(PrintDocument document)
   at System.Drawing.Printing.PrintDocument.Print()
   at MangZhuan.Forms.FormException.btnPrint_Click(Object sender, EventArgs e) in E:\vsproject\MangZhuan\MangZhuan\Forms\FormException.cs:line 121
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at Sunny.UI.UIButton.OnClick(EventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at Sunny.UI.UIControl.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 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.RunDialog(Form form)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at System.Windows.Forms.Form.ShowDialog()
   at MangZhuan.Forms.FormRealAlarms.uiDataGridView1_CellContentClick(Object sender, DataGridViewCellEventArgs e) in E:\vsproject\MangZhuan\MangZhuan\Forms\FormRealAlarms.cs:line 92
   at System.Windows.Forms.DataGridView.OnCellContentClick(DataGridViewCellEventArgs e)
   at System.Windows.Forms.DataGridView.OnCommonCellContentClick(Int32 columnIndex, Int32 rowIndex, Boolean doubleClick)
   at System.Windows.Forms.DataGridViewCell.OnMouseUpInternal(DataGridViewCellMouseEventArgs e)
   at System.Windows.Forms.DataGridView.OnCellMouseUp(DataGridViewCellMouseEventArgs e)
   at System.Windows.Forms.DataGridView.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.DataGridView.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 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.RunDialog(Form form)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at System.Windows.Forms.Form.ShowDialog()
   at MangZhuan.Form1.btnTest_Click(Object sender, EventArgs e) in E:\vsproject\MangZhuan\MangZhuan\Form1.cs:line 823
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at Sunny.UI.UIButton.OnClick(EventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at Sunny.UI.UIControl.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 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNative
 

相关推荐

  1. C# winform 打印Excel

    2024-07-16 12:02:04       22 阅读
  2. python 做成Excel并设置打印区域

    2024-07-16 12:02:04       27 阅读
  3. python与excel第五节 打印excel

    2024-07-16 12:02:04       34 阅读
  4. Python自动打开Excel文件

    2024-07-16 12:02:04       34 阅读
  5. Pandas 打开有密码的Excel

    2024-07-16 12:02:04       47 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-16 12:02:04       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-16 12:02:04       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-16 12:02:04       58 阅读
  4. Python语言-面向对象

    2024-07-16 12:02:04       69 阅读

热门阅读

  1. Linux容器篇-kubernetes监控和日志管理

    2024-07-16 12:02:04       23 阅读
  2. PG参数深入了解

    2024-07-16 12:02:04       22 阅读
  3. AI安全入门-人工智能数据与模型安全

    2024-07-16 12:02:04       24 阅读
  4. 容器安全最佳实践和工具

    2024-07-16 12:02:04       27 阅读
  5. 小程序图片设置大小

    2024-07-16 12:02:04       22 阅读
  6. 实战:Linux下静默安装DM达梦数据库

    2024-07-16 12:02:04       28 阅读
  7. Redis中lua脚本和pipeline的区别

    2024-07-16 12:02:04       24 阅读