Fast Excel import and export
原文:http://www.codeproject.com/Tips/829389/Fast-Excel-import-and-export
相关项目代码:https://github.com/jsegarra1971/SejExcelExport
ExcelReader myReader=new ExcelReader("this_is_my_excel_file.xlsx"); // Open the file
myReader.Process(OnExcelCell); // Process it
void OnExcelCell(char Column, int RowNumber, string value)
{
if (Column=='#') Console.Write("Row: "+RowNumber);
else Console.Write("Column: "+Column+" Value: "+value);
}
ExcelWriter t = new ExcelWriter("Template.xlsx"); // This is the template
MySampleData data = new MySampleData(); // This is the IDataReader
t.Export(data,"output_file.xlsx"); // Use the template to create the data file
….
还没有评论,来说两句吧...