I need to put a check symbol in this cell if the condition met. Here's my sample code:
private SXSSFWorkbook RepWkBook = null;
private SXSSFSheet RepSheet = null;
private int RepRowNum = 0;
private ResultSet RepResult = null;
private Row RepRow = null;
RepSheet = RepWkBook.createSheet(reportType);
RepRowNum = 0;
Row row = RepSheet.createRow(RepRowNum++);
CellStyle cellStyle = RepWkBook.createCellStyle();
Font font = RepWkBook.createFont();
font.setBold(true);
cellStyle.setFont(font);cell = RepRow.createCell(col++);
boolean isMOBhigherThanArea = RepResult.getString("IS_MOB_HIGHER_THAN_AREA").equalsIgnoreCase("1");
char st = '\u2713';
if(isMOBhigherThanArea && (!areaStr.equalsIgnoreCase("No Data") || !mobStr.equalsIgnoreCase("No Data"))) {
cell.setCellValue(st);}
I already used
UTF-16 - feff2713
UTF-16BE - 2713
UTF-16LE - 1327
UTF-8 - e29c93
click here for sample output SAMPLE EXPECTED OUTPUT
Area | MOB Target | Area Result | MOB > Area
City | 85% | 80% | ✔
There is no method
setCellValuewhich takes achar. Try using aStringthere.The following works for me:
Result: