在c#中导出到excel中的说明关于在c#中导出到excel中的说明
在c#中导出到excel中的说明
在c#中导出到excel中的说明在c#中导出到excel可以使用两种方式,在导出少量数据时采用方式一,在导出大量数据时采用方式二。
在c#中导出到excel中的说明方式一:使用创建excel对象,直接对excel进行读写操作,不过写数据时是一个单元格一个单元格的方式写的,效率很低。
在c#中导出到excel中的说明代码如下:
在c#中导出到excel中的说明先在项目中添加Microsoft Excel 
9.0 Object Library的引用,然后在代码中添加引用:using Excel;
在c#中导出到excel中的说明ApplicationClass myApp
=null;
在c#中导出到excel中的说明            Workbook myBook
=null;
在c#中导出到excel中的说明            Worksheet mySheet1
=null;
在c#中导出到excel中的说明        myApp
= new ApplicationClass();
在c#中导出到excel中的说明            myApp.Visible
=false;
在c#中导出到excel中的说明                
在c#中导出到excel中的说明            
object oMissiong=System.Reflection.Missing.Value;            myApp.Workbooks.Open(path,oMissiong,oMissiong,oMissiong,oMissiong,oMissiong,oMissiong,oMissiong,oMissiong,oMissiong,oMissiong,oMissiong,oMissiong);
在c#中导出到excel中的说明            myBook
=myApp.Workbooks[1];
在c#中导出到excel中的说明            mySheet1
=(Worksheet)myBook.Worksheets[1];
在c#中导出到excel中的说明
int iSheet=BusinessFacade.DepreciateSystem.GetpaSheet1Count(this.drpMonth.SelectedItem.Value,this.drpAnual.SelectedItem.Value)/65000;
在c#中导出到excel中的说明            
for(int i=1;i<iSheet+1;i++)
GO

相关文章:

  • 2022-12-23
  • 2021-09-13
  • 2021-10-12
  • 2022-12-23
  • 2021-10-12
  • 2021-10-28
  • 2022-02-02
猜你喜欢
  • 2021-07-20
  • 2022-12-23
  • 2021-12-14
  • 2021-10-18
相关资源
相似解决方案