I am using XSSFWorkbook to generate an Excel document (.xlsx), but, I have not managed to apply borders to the cells using:
XSSFCellStyle style3 = workbook.createCellStyle();
style3.setBorderBottom(XSSFCellStyle.BORDER_MEDIUM);
style3.setBorderTop(XSSFCellStyle.BORDER_MEDIUM);
style3.setBorderRight(XSSFCellStyle.BORDER_MEDIUM);
style3.setBorderLeft(XSSFCellStyle.BORDER_MEDIUM);
Error I receive:
BORDER_MEDIUM can not be resolved or is not a field
Libraries that I have imported:
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFFont;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
.jar's of my project:
I'm missing some .jar
, what? I have researched and I have not found a solution.