/** * Add a row to the _sheet * * @param AddLow whether to Add the row to the low level model - false if its already there */ private void AddRow(HSSFRow row, bool addLow) { rows[row.RowNum] = row; if (addLow) { _sheet.AddRow(row.RowRecord); } bool firstRow = rows.Count == 1; if (row.RowNum > LastRowNum || firstRow) { lastrow = row.RowNum; } if (row.RowNum < FirstRowNum || firstRow) { firstrow = row.RowNum; } }
/// <summary> /// Create a new row within the _sheet and return the high level representation /// </summary> /// <param name="rownum">The row number.</param> /// <returns></returns> /// @see org.apache.poi.hssf.usermodel.HSSFRow /// @see #RemoveRow(HSSFRow) public LF.Utils.NPOI.SS.UserModel.IRow CreateRow(int rownum) { HSSFRow row = new HSSFRow(_workbook, this, rownum); AddRow(row, true); return row; }
/// <summary> /// Used internally to Create a high level Row object from a low level row object. /// USed when Reading an existing file /// </summary> /// <param name="row">low level record to represent as a high level Row and Add to _sheet.</param> /// <returns>HSSFRow high level representation</returns> private HSSFRow CreateRowFromRecord(RowRecord row) { HSSFRow hrow = new HSSFRow(_workbook, this, row); AddRow(hrow, false); return hrow; }
private void NotifyRowShifting(HSSFRow row) { String msg = "Row[rownum=" + row.RowNum + "] contains cell(s) included in a multi-cell array formula. " + "You cannot change part of an array."; foreach (ICell cell in row.Cells) { HSSFCell hcell = (HSSFCell)cell; if (hcell.IsPartOfArrayFormulaGroup) { hcell.NotifyArrayFormulaChanging(msg); } } }