Sheet sheet = wb.createSheet("Accounts");
int rowNum = 1;
Row row = sheet.createRow(rowNum++);
Font font = wb.createFont();
font.setFontHeightInPoints((short)24);
font.setFontName(FONT_TYPE);
font.setColor(FONT_COLOR_TITLE);
/*** Header *****/
CellStyle style = wb.createCellStyle();
style.setFont(font);
style.setAlignment(CellStyle.ALIGN_CENTER);
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style.setFillForegroundColor(BACKGROUND_COLOR);
Cell cell = row.createCell((short) 1);
cell.setCellValue("Account Report per Beneficiary");
cell.setCellStyle(style);
sheet.addMergedRegion(new CellRangeAddress(
1, //first row (0-based)
2, //last row (0-based)
1, //first column (0-based)
16 //last column (0-based)
));
/*** Body *****/
font = wb.createFont();
font.setFontHeightInPoints((short)12);
font.setFontName(FONT_TYPE);
font.setColor(FONT_COLOR);
style = wb.createCellStyle();
style.setFont(font);
rowNum = rowNum + 3;