You have to create the cell using row2.createCell(1)
before setting the value.
How to insert value in merged cell poi java
-
07-07-2023 - |
문제
i have created new row then merge two cells then i want to get this merged cell to put value in it
my code :
sheet.createRow(1);
HSSFRow row2 = sheet.getRow(1);
HSSFCell cell = row2.getCell(1);
cell.setCellValue("معلومات الطالب");
sheet.addMergedRegion(CellRangeAddress.valueOf("A2:B2"));
but i get error java.lang.NullPointerException
해결책
제휴하지 않습니다 StackOverflow