Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EPplus To Insert X Number of Blank Rows

I have an instance where if a cell value is between 15 and 25 then I need to insert 10 blank rows, if the cell value is > 30 I need to insert 25 blank rows

Rather than simply typing the same syntax repeatedly and adding 1 row at a time, does EPPLUS have a function of adding X rows at one time?

This works but will be lots of code repeated:

ws.InsertRow(31, 31, 1);
like image 551
Smith Stanley Avatar asked Aug 07 '17 14:08

Smith Stanley


1 Answers

The method you are using already takes care of that.

w.InsertRow(10, 15);

This will insert 15 rows starting at row 10. All the rows under will be shifted down.

The actual method signature:public void InsertRow(int rowFrom, int rows);

like image 139
Felix Poitras Avatar answered Sep 19 '22 14:09

Felix Poitras