Hi,I have generated the EXCEL in java using Apache POI XSSF. After generating the report I am trying to open the excel file,it is showing error("Excel found unreadable content").Please find the below source code: public void writeSheet(ArrayList<ArrayList<String>> data, String sheetName) {

File file = new File(fileName);
XSSFWorkbook workbook = new XSSFWorkbook();
out = new FileOutputStream(file);
XSSFSheet sheet = workbook.createSheet(sheetName);
ArrayList<String> cells = new ArrayList<String>();
XSSFCell cell = null;
int noofRows = data.size();
XSSFRow row = null;
int noofColumns = 0;
String content = "";
for(int i = 0 ; i < noofRows ; i++) {
row = sheet.createRow(i);
cells = data.get(i);
noofColumns = cells.size();
for(int j = 0 ; j < noofColumns ; j++) {

cell = row.createCell(j);
content = cells.get(j);
setCellAttibutes(cell, content);
}
}
}
public XSSFCell setCellAttibutes(XSSFCell cell, String code ) {
XSSFCellStyle style = workbook.createCellStyle();
String str[] = code.split("<csp>");
if(str.length== 0) {
cell.setCellValue(code);
style.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
style.setFillForegroundColor(IndexedColors.WHITE.getIndex());
} else if(str.length == 1) {
cell.setCellValue(str[0]);
style.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
style.setFillForegroundColor(IndexedColors.WHITE.getIndex());
} else if(str.length == 2) {
style.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
style.setFillForegroundColor(IndexedColors.valueOf(str[0]).getIndex());
cell.setCellValue(str[1]);
} else if(str.length == 3) {
HSSFHyperlink url_link=new HSSFHyperlink(HSSFHyperlink.LINK_URL);
url_link.setAddress(str[0]);
/cell.setHyperlink(url_link);
style.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
style.setFillForegroundColor(IndexedColors.valueOf(str[1]).getIndex());
cell.setCellValue(str[2]);
}

style.setBorderBottom(XSSFCellStyle.BORDER_THIN);
style.setBorderTop(XSSFCellStyle.BORDER_THIN);
style.setBorderRight(XSSFCellStyle.BORDER_THIN);
style.setBorderLeft(XSSFCellStyle.BORDER_THIN);

cell.setCellStyle(style);

return cell;
}