المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : C# - Fill a .xlsx / .xls - file with data based on a grid



C# Programming
03-02-2010, 01:41 PM
Hey,

I have my data in a grid (no datagridview), export a grid (30 cols and over 20.000 rows) takes a lot of time (minimum 2minutes)... http://www.barakasoft.com/script/Forums/Images/smiley_dead.gif

now my question: Is there a way to accelerate this?

for (int i = 0; i < UsingGrid.Cols; i++)
{
for (int j = 0; j < UsingGrid.Rows; j++)
{
worksheet.Cells[j + 1, i + 1] = ConvertToExcelFormat(Convert.ToString(UsingGrid[j, i]));
}
}
Thank you