Форум для тех, кто программирует под Android
-
Гость
Android POI: сбой при использовании autoSizeColumn()
Сообщение
Гость »
метод POI выдает исключение, которое мне не удалось разрешить:
Код: Выделить всё
"java.lang.ClassNotFoundException: Didn't find class "java.awt.font.FontRenderContext" on path:..."
с этой ошибкой
Код: Выделить всё
"java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/font/FontRenderContext;"
Вот мой код, метод вызывается после помещения данных в столбец:
Код: Выделить всё
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 = sheet1.createRow(0);
c = row.createCell(0);
c.setCellValue("Quantité");
c.setCellStyle(cs);
c = row.createCell(1);
c.setCellValue("Code barre");
c.setCellStyle(cs);
c = row.createCell(2);
c.setCellValue("Association");
c.setCellStyle(cs);
int m = 0;
for(int k=0;k
Подробнее здесь: [url]https://stackoverflow.com/questions/37069820/android-poi-crash-when-using-autosizecolumn[/url]
1714448992
Гость
[code]autoSizeColumn[/code] метод POI выдает исключение, которое мне не удалось разрешить:
[code] "java.lang.ClassNotFoundException: Didn't find class "java.awt.font.FontRenderContext" on path:..."
[/code]
с этой ошибкой
[code]"java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/font/FontRenderContext;"
[/code]
Вот мой код, метод вызывается после помещения данных в столбец:
[code] 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 = sheet1.createRow(0);
c = row.createCell(0);
c.setCellValue("Quantité");
c.setCellStyle(cs);
c = row.createCell(1);
c.setCellValue("Code barre");
c.setCellStyle(cs);
c = row.createCell(2);
c.setCellValue("Association");
c.setCellStyle(cs);
int m = 0;
for(int k=0;k
Подробнее здесь: [url]https://stackoverflow.com/questions/37069820/android-poi-crash-when-using-autosizecolumn[/url]