Fast Excel import and export

Love The Way You Lie 2022-08-13 08:30 227阅读 0赞

原文:http://www.codeproject.com/Tips/829389/Fast-Excel-import-and-export

相关项目代码:https://github.com/jsegarra1971/SejExcelExport

  1. ExcelReader myReader=new ExcelReader("this_is_my_excel_file.xlsx"); // Open the file
  2. myReader.Process(OnExcelCell); // Process it
  3. void OnExcelCell(char Column, int RowNumber, string value)
  4. {
  5. if (Column=='#') Console.Write("Row: "+RowNumber);
  6. else Console.Write("Column: "+Column+" Value: "+value);
  7. }
  8. ExcelWriter t = new ExcelWriter("Template.xlsx"); // This is the template
  9. MySampleData data = new MySampleData(); // This is the IDataReader
  10. t.Export(data,"output_file.xlsx"); // Use the template to create the data file

….

发表评论

表情:
评论列表 (有 0 条评论,227人围观)

还没有评论,来说两句吧...

相关阅读