Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

Created Unassigned: FillForegroundColor is slow [14016]

$
0
0
I have a template and after filling it with values I set a background color but for a small file (about 6000 rows) it takes about 4 minutes. Whithout setting background color it takes only 8 seconds.

My code is:
var hssfworkbook = new XSSFWorkbook(file);
var sheet = hssfworkbook.GetSheetAt(0);

for (int i=0; i<sheet.LastRowNum; i++)
{
var currentCellStyle = hssfworkbook.CreateCellStyle();
currentCellStyle.FillForegroundColor = IndexedColors.Green.Index;
currentRow.Cells.ForEach(x=> x.CellStyle = currentCellStyle);
}

Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>