HSSFSheet worksheet = workbook.createSheet(getResourceBundle().getString("MAIN_WORKSHEET"));
if ((objects != null) && !(objects.isEmpty())) {
int lineNumber = 0;
for (Object o : objects) {
AbstractTAA taa = (AbstractTAA) o;
// index from 0,0... cell A1 is cell(0,0)
HSSFRow row1 = worksheet.createRow(lineNumber);
HSSFCell cellA1 = row1.createCell(0);
cellA1.setCellValue(getResourceBundle().getString("TAA_LICENSE_NUMBER"));
HSSFCellStyle cellStyle = workbook.createCellStyle();
cellStyle.setFillForegroundColor(HSSFColor.CORAL.index);
cellStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
cellA1.setCellStyle(cellStyle);
HSSFCell cellB1 = row1.createCell(1);
cellB1.setCellValue(getResourceBundle().getString("TAA_VERSION_NUMBER"));
cellStyle = workbook.createCellStyle();
cellStyle.setFillForegroundColor(HSSFColor.AQUA.index);
cellStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
cellB1.setCellStyle(cellStyle);
HSSFRow row2 = worksheet.createRow(++lineNumber);
HSSFCell cellA2 = row2.createCell(0);
cellA2.setCellValue(taa.getLicenseNumber());
HSSFCell cellB2 = row2.createCell(1);
cellB2.setCellValue(taa.getVersionNumber());
lineNumber = lineNumber + 2;
}
}
}