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

New Post: Slow performance with range copy

$
0
0
Hi!

I try to produce print form in Excel. My approach is that before filling data, I try copy first page (like template) several times. And this copying extremly slow.
            for (int i = 1; i < subscriptionsByPages.Count(); i++) {
                ws.Cell("A" + (i * verticalPageSize + 1)).Value = ws.Range("A1:AB45");
            }
This code take about 95% of time and take about 5 minutes for 35-40 print page (1600-1800 rows on the sheet). I profile code and my result is:
set_Value - 95.5%
SetRange - 95.5%
[mscorlib.ni.dll] - 95.4%
Merge - 95.4%
Merge - 95.2%
Intersect - 94.7%
Dispose - 79.5% (another - Range 14.7%)
remove_RangeShiftedRows - 40.3% and removeRangeShiftedColumns - 39.1%

I use version 0.69.1.0.

What can I do for improving perfomance? May be it is wrong approach - to copy by range? Or I incorrect set value? Any suggestions, advices?

Viewing all articles
Browse latest Browse all 1877

Trending Articles



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