如何在Apache POI中设置固定列宽.我想让我的第一列固定宽度.
我试过了sheet.setColumnWidth(0,1000); cellStyle.setWrapText(真); //设置wordwrap它没有反映
public XSSFWorkbook generateReport(List<Dto> result, boolean isRes, boolean isRes1) {
XSSFWorkbook workbook = null;
XSSFSheet sheet = null;
XSSFRow row = null;
XSSFCell cell = null;
String[] headers = null;
int rowNum = 0;
int colNum = 0;
CellStyle cellStyle = null;
CellStyle headerStyle = null;
XSSFFont font = null;
CellStyle datecellStyle = null;
/* set the weight of the font */
try {
workbook = new XSSFWorkbook();
headers = new String[] { ...values goes here...}; …Run Code Online (Sandbox Code Playgroud)