Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Edited Unassigned: EPPlus 4.05 ExcelRange.Copy single row to multiple rows only creates single row (Useful for copying template formulaes) [15447]

$
0
0
I've attached a sample project, which does the same tasks in EPPlus & using the Excel Interop. It uses the, latest, (v16) Excel Interop but is not reliant upon this.

Copy from C1:D1 from a worksheet to C1:D100 to another worksheet, only creates a single row on the destination worksheet (instead of duplicating the row over the 100 lines). This works as expected using Excel interop.

I created a workaround by calling a function to manage this fix internally for the short term.

To see this workaround uncomment the 1st line in TestEPPlus.cs.
public static void Copy(ExcelRange srcRange, ExcelRange dstRange)
{
if (srcRange.Rows == dstRange.Rows)
srcRange.Copy(dstRange);
else
{
for (int row = dstRange.Start.Row; row <= dstRange.End.Row; ++row)
srcRange.Copy(dstRange.Worksheet.Cells[row, dstRange.Start.Column, row, dstRange.End.Column]);
}
}


Viewing all articles
Browse latest Browse all 2262

Trending Articles



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