[C#]WinForm中DataGrid - 导出Excel文件

在WinForm开发中,经常需要将DataGrid中显示的数据导出各种文件格式。现以导出Excel为例:

1、继承Net的DataGrid

【原创】[C#]WinForm中DataGrid扩展 - 导出Excel文件(1)public class DataGridEx : System.Windows.Forms.DataGrid    

2、添加Excel引用
【原创】[C#]WinForm中DataGrid扩展 - 导出Excel文件(1)

3、编写导出方法

【原创】[C#]WinForm中DataGrid扩展 - 导出Excel文件(1)public bool ExportExcel()
        }


开发环境:
VS.Net 2003

缺陷:导出速度慢,曾考虚过多线程,但效果并不理想。
8000条数据大约需要6分钟。请高手多指教!

**************************************
本系列相关文章,敬请关注
完整的DataGridEx原代码,正在整理中,有需要请留言)。
------------------------------------------------------
[C#]WinForm中DataGrid扩展 - 导出Excel文件 (1)
[C#]WinForm中DataGrid扩展 - 快速导出Excel文件 (1)(续)
[C#]WinForm中DataGrid扩展 - 列样式扩展(2)
[C#]WinForm中DataGrid扩展 - 自定义行颜色(3)
[C#]WinForm中DataGrid扩展 - 多列排序(4)
[C#]WinForm中DataGrid扩展 - 自动生成列样式(5)


 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2021-06-10
  • 2021-08-07
  • 2022-02-14
  • 2021-09-30
猜你喜欢
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案