Tag: java 7

在使用LibreOffice Calc打开文件时,使用apache poi在java中的行3000到3005中写入图像

我使用poi 3.9来创buildxlsx文件,一切正常,直到我的文件长度超过1600行 。 跨过1600行后,我能写数据,但我无法写图像所有图像相互追加在行号1640这是奇怪的,我正在poi从长时间,并select了它的库限制和更新的问题我的诗到3.15但同样的问题,在这里我能够写图像高达2000行,然后我试图poi 3.16但是问题是一样的,但在这里,我可以写图像高达2500行 。 以下是我写图片的代码 private void drawImageOnExcelSheet(XSSFSheet sitePhotosSheet, int row1, int row2, int col1, int col2, String fileName) { try { InputStream is = new FileInputStream(fileName); byte[] bytes = IOUtils.toByteArray(is); int pictureIdx = sitePhotosSheet.getWorkbook().addPicture(bytes,Workbook.PICTURE_TYPE_JPEG); is.close(); CreationHelper helper = sitePhotosSheet.getWorkbook().getCreationHelper(); Drawing drawing = sitePhotosSheet.createDrawingPatriarch(); ClientAnchor anchor = helper.createClientAnchor(); anchor.setAnchorType(AnchorType.MOVE_AND_RESIZE); anchor.setCol1(col1); anchor.setCol2(col2); anchor.setRow1(row1); anchor.setRow2(row2); […]