/** * Merges the specified cells. Any clashes or intersections between * merged cells are resolved when the spreadsheet is written out * * @param col1 the column number of the top left cell * @param row1 the row number of the top left cell * @param col2 the column number of the bottom right cell * @param row2 the row number of the bottom right cell * @return the Range object representing the merged cells * @exception jxl.write..WriteException * @exception jxl.write.biff.RowsExceededException */ public Range mergeCells(int col1, int row1, int col2, int row2) throws WriteException, RowsExceededException { // First check that the cells make sense if (col2 < col1 || row2 < row1) { logger.warn("Cannot merge cells - top left and bottom right "+ "incorrectly specified"); } // Make sure the spreadsheet is up to size if (col2 >= numColumns || row2 >= numRows) { addCell(new Blank(col2, row2)); } SheetRangeImpl range = new SheetRangeImpl(this, col1, row1, col2, row2); mergedCells.add(range); return range; }
/** * Merges the specified cells. Any clashes or intersections between * merged cells are resolved when the spreadsheet is written out * * @param col1 the column number of the top left cell * @param row1 the row number of the top left cell * @param col2 the column number of the bottom right cell * @param row2 the row number of the bottom right cell * @return the Range object representing the merged cells * @exception jxl.write..WriteException * @exception jxl.write.biff.RowsExceededException */ public Range mergeCells(int col1, int row1, int col2, int row2) throws WriteException, RowsExceededException { // First check that the cells make sense if (col2 < col1 || row2 < row1) { logger.warn("Cannot merge cells - top left and bottom right "+ "incorrectly specified"); } // Make sure the spreadsheet is up to size if (col2 >= numColumns || row2 >= numRows) { addCell(new Blank(col2, row2)); } SheetRangeImpl range = new SheetRangeImpl(this, col1, row1, col2, row2); mergedCells.add(range); return range; }
toSheet.addCell(c);
toSheet.addCell(c);
toSheet.addCell(c);
toSheet.addCell(c);
toSheet.addCell(c);
toSheet.addCell(c);
toSheet.addCell(c);
toSheet.addCell(c);
sheet.addCell(new Blank(topLeft.getColumn(), bottomRight.getRow(), cf2)); sheet.addCell(new Blank(topLeft.getColumn(), i, cf3)); sheet.addCell(new Blank(bottomRight.getColumn(), topLeft.getRow(), cf6)); sheet.addCell(new Blank(bottomRight.getColumn(), i, cf7)); sheet.addCell(new Blank(i, topLeft.getRow(), cf8)); sheet.addCell(new Blank(bottomRight.getColumn(), bottomRight.getRow(), cf4)); sheet.addCell(new Blank(i, bottomRight.getRow(), cf5));
sheet.addCell(new Blank(topLeft.getColumn(), bottomRight.getRow(), cf2)); sheet.addCell(new Blank(topLeft.getColumn(), i, cf3)); sheet.addCell(new Blank(bottomRight.getColumn(), topLeft.getRow(), cf6)); sheet.addCell(new Blank(bottomRight.getColumn(), i, cf7)); sheet.addCell(new Blank(i, topLeft.getRow(), cf8)); sheet.addCell(new Blank(bottomRight.getColumn(), bottomRight.getRow(), cf4)); sheet.addCell(new Blank(i, bottomRight.getRow(), cf5));
validation.shareDataValidation(sourceDataValidation); b.setCellFeatures(validation); addCell(b);
validation.shareDataValidation(sourceDataValidation); b.setCellFeatures(validation); addCell(b);