HSSFRegionUtilpublic class HSSFRegionUtil extends Object Various utility functions that make working with a region of cells easier. |
Constructors Summary |
---|
private HSSFRegionUtil()Constructor for the HSSFRegionUtil object
|
Methods Summary |
---|
public static void | setBorderBottom(short border, org.apache.poi.hssf.util.Region region, org.apache.poi.hssf.usermodel.HSSFSheet sheet, org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)Sets the borderBottom attribute of the HSSFRegionUtil object
int colStart = region.getColumnFrom();
int colEnd = region.getColumnTo();
int rowIndex = region.getRowTo();
HSSFRow row = HSSFCellUtil.getRow( rowIndex, sheet );
for ( int i = colStart; i <= colEnd; i++ ) {
HSSFCell cell = HSSFCellUtil.getCell( row, i );
HSSFCellUtil.setCellStyleProperty( cell, workbook, "borderBottom", new Short( border ) );
}
| public static void | setBorderLeft(short border, org.apache.poi.hssf.util.Region region, org.apache.poi.hssf.usermodel.HSSFSheet sheet, org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)Sets the left border for a region of cells by manipulating the cell style
of the indidual cells on the left
int rowStart = region.getRowFrom();
int rowEnd = region.getRowTo();
int column = region.getColumnFrom();
for ( int i = rowStart; i <= rowEnd; i++ ) {
HSSFRow row = HSSFCellUtil.getRow( i, sheet );
HSSFCell cell = HSSFCellUtil.getCell( row, column );
HSSFCellUtil.setCellStyleProperty( cell, workbook, "borderLeft", new Short( border ) );
}
| public static void | setBorderRight(short border, org.apache.poi.hssf.util.Region region, org.apache.poi.hssf.usermodel.HSSFSheet sheet, org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)Sets the borderRight attribute of the HSSFRegionUtil object
int rowStart = region.getRowFrom();
int rowEnd = region.getRowTo();
int column = region.getColumnTo();
for ( int i = rowStart; i <= rowEnd; i++ ) {
HSSFRow row = HSSFCellUtil.getRow( i, sheet );
HSSFCell cell = HSSFCellUtil.getCell( row, column );
HSSFCellUtil.setCellStyleProperty( cell, workbook, "borderRight", new Short( border ) );
}
| public static void | setBorderTop(short border, org.apache.poi.hssf.util.Region region, org.apache.poi.hssf.usermodel.HSSFSheet sheet, org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)Sets the borderBottom attribute of the HSSFRegionUtil object
int colStart = region.getColumnFrom();
int colEnd = region.getColumnTo();
int rowIndex = region.getRowFrom();
HSSFRow row = HSSFCellUtil.getRow( rowIndex, sheet );
for ( int i = colStart; i <= colEnd; i++ ) {
HSSFCell cell = HSSFCellUtil.getCell( row, i );
HSSFCellUtil.setCellStyleProperty( cell, workbook, "borderTop", new Short( border ) );
}
| public static void | setBottomBorderColor(short color, org.apache.poi.hssf.util.Region region, org.apache.poi.hssf.usermodel.HSSFSheet sheet, org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)Sets the bottomBorderColor attribute of the HSSFRegionUtil object
int colStart = region.getColumnFrom();
int colEnd = region.getColumnTo();
int rowIndex = region.getRowTo();
HSSFRow row = HSSFCellUtil.getRow( rowIndex, sheet );
for ( int i = colStart; i <= colEnd; i++ ) {
HSSFCell cell = HSSFCellUtil.getCell( row, i );
HSSFCellUtil.setCellStyleProperty( cell, workbook, "bottomBorderColor", new Short( color ) );
}
| public static void | setLeftBorderColor(short color, org.apache.poi.hssf.util.Region region, org.apache.poi.hssf.usermodel.HSSFSheet sheet, org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)Sets the leftBorderColor attribute of the HSSFRegionUtil object
int rowStart = region.getRowFrom();
int rowEnd = region.getRowTo();
int column = region.getColumnFrom();
for ( int i = rowStart; i <= rowEnd; i++ ) {
HSSFRow row = HSSFCellUtil.getRow( i, sheet );
HSSFCell cell = HSSFCellUtil.getCell( row, column );
HSSFCellUtil.setCellStyleProperty( cell, workbook, "leftBorderColor", new Short( color ) );
}
| public static void | setRightBorderColor(short color, org.apache.poi.hssf.util.Region region, org.apache.poi.hssf.usermodel.HSSFSheet sheet, org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)Sets the rightBorderColor attribute of the HSSFRegionUtil object
int rowStart = region.getRowFrom();
int rowEnd = region.getRowTo();
int column = region.getColumnTo();
for ( int i = rowStart; i <= rowEnd; i++ ) {
HSSFRow row = HSSFCellUtil.getRow( i, sheet );
HSSFCell cell = HSSFCellUtil.getCell( row, column );
HSSFCellUtil.setCellStyleProperty( cell, workbook, "rightBorderColor", new Short( color ) );
}
| public static void | setTopBorderColor(short color, org.apache.poi.hssf.util.Region region, org.apache.poi.hssf.usermodel.HSSFSheet sheet, org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)Sets the topBorderColor attribute of the HSSFRegionUtil object
int colStart = region.getColumnFrom();
int colEnd = region.getColumnTo();
int rowIndex = region.getRowFrom();
HSSFRow row = HSSFCellUtil.getRow( rowIndex, sheet );
for ( int i = colStart; i <= colEnd; i++ ) {
HSSFCell cell = HSSFCellUtil.getCell( row, i );
HSSFCellUtil.setCellStyleProperty( cell, workbook, "topBorderColor", new Short( color ) );
}
|
|