/// <summary> /// Gets the row height in points. /// </summary> /// <param name="sheet">The sheet.</param> /// <param name="rowNum">The row num.</param> /// <returns></returns> private float GetRowHeightInPoints(Frame.Utils.NPOI.SS.UserModel.ISheet sheet, int rowNum) { Frame.Utils.NPOI.SS.UserModel.IRow row = sheet.GetRow(rowNum); if (row == null) { return(sheet.DefaultRowHeightInPoints); } else { return(row.HeightInPoints); } }
/// <summary> /// Sets the topBorderColor attribute of the HSSFRegionUtil object /// </summary> /// <param name="color">The color of the border</param> /// <param name="region">The region that should have the border</param> /// <param name="sheet">The sheet that the region is on.</param> /// <param name="workbook">The workbook that the region is on.</param> public static void SetTopBorderColor(int color, CellRangeAddress region, HSSFSheet sheet, HSSFWorkbook workbook) { int colStart = region.FirstColumn; int colEnd = region.LastColumn; int rowIndex = region.FirstRow; CellPropertySetter cps = new CellPropertySetter(workbook, HSSFCellUtil.TOP_BORDER_COLOR, color); Frame.Utils.NPOI.SS.UserModel.IRow row = HSSFCellUtil.GetRow(rowIndex, sheet); for (int i = colStart; i <= colEnd; i++) { cps.SetProperty(row, i); } }
public void SetProperty(Frame.Utils.NPOI.SS.UserModel.IRow row, int column) { Frame.Utils.NPOI.SS.UserModel.ICell cell = HSSFCellUtil.GetCell(row, column); HSSFCellUtil.SetCellStyleProperty(cell, _workbook, _propertyName, _propertyValue); }