autoSizeColumn POI的方法抛出了我无法解决的异常:
"java.lang.ClassNotFoundException: Didn't find class "java.awt.font.FontRenderContext" on path:..."
Run Code Online (Sandbox Code Playgroud)
有这个错误
"java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/font/FontRenderContext;"
Run Code Online (Sandbox Code Playgroud)
这是我的代码,在将数据放入列后调用该方法:
private boolean saveExcelFile(Context context, String fileName) {
if (!isExternalStorageAvailable() || isExternalStorageReadOnly()) {
Log.e("ExcelLog", "Storage not available or read only");
return false;
}
boolean success = false;
Cell c;
Workbook wb = new HSSFWorkbook();
CellStyle cs = wb.createCellStyle();
cs.setFillForegroundColor(HSSFColor.LIGHT_ORANGE.index);
cs.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
Sheet sheet1;
sheet1 = wb.createSheet("Historique du "+date);
MultiFormatWriter writer = new MultiFormatWriter();
Bitmap ImageBitmap;
CreationHelper helper = wb.getCreationHelper();
Drawing drawing = sheet1.createDrawingPatriarch();
Row row = …Run Code Online (Sandbox Code Playgroud)