This project is read-only.
Project Description
Excel methods, like as read, write, create excel file, export ,and import. support excel 2003 and 2007.



Test code
Stopwatch stopwatch = new Stopwatch();

// code
SmartExcelHelper excel = new SmartExcelHelper();

excel.Add(new ExcelCell(1, 1, "test1,1"));
excel.Add(new ExcelCell(1, 2, "test1,2"));
excel.Add(new ExcelCell(2, 2, "test2,2"));
excel.Add(new ExcelCell(2, 3, "test2,3"));

excel.CreateFile(@"C:\test.xls");
excel.CloseFile();

stopwatch.Stop();
Console.WriteLine("Elapse Milliseconds {0} ms", stopwatch.ElapsedMilliseconds);


stopwatch.Reset(); //reset to 0

stopwatch.Start();
//code
SmartExcelHelper excel2 = new SmartExcelHelper();

for (int i = 0; i < 500; i++)
{

for (int k = 0; k < 10; k++)
{
excel2.Add(new ExcelCell(i, k, string.Format("{0}-{1}",i,k)));
}
}


excel2.CreateFile(@"C:\test2.xls");
excel2.CloseFile();

stopwatch.Stop();
Console.WriteLine("Elapse Milliseconds{0} ms", stopwatch.ElapsedMilliseconds);
//result total 27ms

Console.WriteLine("Press any key to exit");
Console.ReadKey();

Last edited Sep 17, 2010 at 9:21 AM by atomsoft, version 2