Hi!

I'm a newer to POI and recently our project change FomulaOne to POI...
Now, I have a problem.

I want to insert rows and columns to Excel. But in POI documents I didn't
found the methods.

I did like this, but the num of row can't do that.

//////////////////////////

public boolean addRows( int row, int num ) throws java.io.IOException {
      if ( row >= 0 && num > 0 ) {
        HSSFRow wRow = workSheet.getRow(row);
        int intMaxRow = workSheet.getLastRowNum();

       for(int il=intMaxRow; il>row; il--) {
            workSheet.getRow(il).setRowNum(il+num);
       }

       for(int ik=0; ik<num; ik++) {
            HSSFRow nRow = workSheet.createRow(row+ik+1);
       }
           return true;
      } else {
           return false;
      }
 }


Reply via email to