Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: CopyTo seems to be slow while copying a lot of lines.

$
0
0
Since the InsertRowBelow() don't keeps the formats and formulas from the root row, I have to copy from the root row. At last i fill in certain values in to the created rows.

rad = ws.Cell("KontoSaldo").Address.RowNumber;
ws.Row(rad).InsertRowsBelow(2000);
for (int i = 1; i <= 2000r; i++)
{
ws.Row(rad).CopyTo(ws.Row(rad + i));
}
FillTheRowsWithValues()

It seems that the CopyTo takes longer time for each time it's copying. On my machine it took about 10 sec the first 200 items, when it comes to about 1000 it's only makes about 20 for each 10 sec.

Viewing all articles
Browse latest Browse all 1877

Trending Articles



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