Xssf merging Queries

743 Views Asked by At

I have this piece of code:::

            XSSFWorkbook workbook1=new XSSFWorkbook(inputStream); 
            XSSFSheet sheet = workbook1.getSheetAt(1); 
            sheet.addMergedRegion(new CellRangeAddress(28,28,5,9));

Now , i have few straight Question. a) how to Set border for the merged region. b) how to set Color inside the merged region c) how to Put some value inside this merged region.

NB:: All needs to be in xssf.

1

There are 1 best solutions below

0
On

You can work with merged cells as one cell. After merging row 28, column 5 to 9 all of them will be one cell which is row 28, column 5. You can do all of your usual cell editing on this cell.

XSSFRow row = sheet.createRow(28);
XSSFCell cell = row.createCell(5);
...