I would like to set all my cells to individual cell styles which I hold in separate object for each cell.
My code looks like this:
- Code: Select all
foreach (var row in sheet.Rows)
{
foreach (var cell in row.Columns)
{
var sourceCellData = rows[cell.Row - 1].Cells[cell.Column - 1];
cell.IgnoreErrorOptions = IgnoreErrorType.NumberAsText;
cell.ApplyStyle((Spire.Xls.Core.IStyle)sourceCellData.Style, new CellStyleFlag()
{
All = true
});
}
}
But unfortunately any manipulation on the "cell" is painfully slow, it takes a couple of minutes for 30000 rows.
I tried using other methods like SetCellValue which is superb fast but I can't see any method for setting style.
What should I do?