Questions tagged [apache-poi]

Apache POI is a Java library for reading and writing various Microsoft file formats, especially Office related ones. It supports OLE2 and OOXML based formats, such as XLS, XLSX, DOC, DOCX, PPT and PPTX as well as a few others.

The mission statement of the Apache POI project is

... to create and maintain Java APIs for manipulating various file formats based upon the Office Open XML standards (OOXML) and Microsoft's OLE 2 Compound Document format (OLE2). This includes Excel formats (.xls and .xlsx), Word (.doc and .docx), PowerPoint (.ppt and .pptx), as well as others to a lesser extent like Visio, Outlook and Publisher.

This tag should be used for questions around using and extending Apache POI. Questions on the .Net port should use the tag instead.

More information on Apache POI, the bug tracker and download links are available from https://poi.apache.org/

If you are starting with Apache POI, you may find the Busy Developer's link very useful : https://poi.apache.org/spreadsheet/quick-guide.html

Apache POI releases are available under the Apache License, Version 2.0.

9727 questions
2
votes
1 answer

How to use Embedded Equations in Java Apache POI library?

I am trying to use "Apache POI" to extract embedded equation and text from a .doc MS Word file into a .ppt MS Powerpoint file, I have successfully extracted text, but how do I extract embedded equations? the Embedded Equations comes out like this if…
CarlLee
  • 3,952
  • 5
  • 23
  • 33
2
votes
4 answers

Verifying integrity of documents

What are the steps to verify integrity of these documents ? doc,docx,docm,odt,rtf,pdf,odf,odp,xls,xlsx,xlsm,ppt,pptm Or at least of some of them. Usually when uploaded to a content repository. I guess that inputStream is always 99,99% read properly…
lisak
  • 21,611
  • 40
  • 152
  • 243
2
votes
1 answer

Android Build Error - MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26) (apache poi)

i'm getting the following error message. Trying to read a xls file using apache poi (version 5.0.0). I'm quit new working with java and android studio so maybe i am just to dumb to see, what went wrong. hope someone can help me. ^^ (if you need more…
justSalkin
  • 21
  • 1
2
votes
0 answers

Apache POI: exclusion of unnecessary dependencies

I am using apache POI to generate simple monthly report (SXSSF)... but I was surprised that final app size increased by 40MB ?!? by simply adding org.apache.poi poi-ooxml
Wooff
  • 1,091
  • 12
  • 23
2
votes
0 answers

Apache POI Update Custom Fields

I have successfully used IKVM.NET to create a .NET DLL for Apache POI, then used it successfully to update properties of a Microsoft Word 2003 document - the author and company and some custom fields. The document references some of these fields in…
bgs264
  • 4,572
  • 6
  • 38
  • 72
2
votes
0 answers

How to get SVG picture data from excel that has been automatically converted to PNG

Excel automatically converts SVG to PNG and saves both the copies. When we use apache poi v5.0.0to fetch the picture data, XSSFPicture picture = (XSSFPicture) shape; System.out.println(picture.getPictureData().suggestFileExtension()); // output:…
dodobird
  • 168
  • 11
2
votes
1 answer

sheet.getRow(rowIndex) returns NULL - APACHE POI

I am using the APACHE POI library to read an excel file in xlsx format. My problem is that I want to remove the last row from each sheet of this excel, I found a way to find the last row to remove, but it returns an int. The method…
Elizama Melo
  • 103
  • 2
  • 10
2
votes
1 answer

Accelerate Apache POI SUMIF

In an xlsx workbook there are some cells with some unbounded SUMIF formulas like this: SUMIF(MySheetname!$B:$B,$E4,MySheetname!$I:$I). The evaluation of one SUMIF function with Apache POI 5.0.0 lasts 100ms and the evaluation of the given workbook…
user14972917
2
votes
2 answers

Java POI edit excel file - cell.setCellValue not working

I'm trying to modify an excel file but for some reason which I do not understand the method Cell.setCellValue does not work in my code. What I'm actually doing is: -I'm opening an excel file and saving the content that interests me in a HashMap.…
h1dr0
  • 23
  • 5
2
votes
1 answer

Apache POI does not update formulas

I am using Apache POI library to use some formulas from the excel sheet but it seems that the formulas are not being updated at a runtime. If I save a workbook and reopen it, they are recalculated. Is there a way to calculate them at a runtime? My…
2
votes
2 answers

Compatibility between Apache Poi 4.1.2 and net.sf.jxls (jxls-core 1.0.6)

I need to know if those libraries mentioned in the title are compatible between each other. What I need to do is to change libraries: from net.sf.jxls to org.jxls 2.10.0 (and therefore adapt the implementation that was made using jxls-core 1.0.6).…
Paul
  • 21
  • 3
2
votes
1 answer

Controlling table row height for document in poi

I am trying to draw a table in poi using XWPF component using the below code // InputStream in= Temp.class.getResourceAsStream("Sample.docx"); XWPFDocument doc = new XWPFDocument(); XWPFTable table=doc.createTable(2,2); // …
lalit
  • 1,485
  • 2
  • 17
  • 32
2
votes
1 answer

convert a Workbook to a Resource

I want to convert a org.apache.poi.ss.usermodel.Workbook to a org.springframework.core.io.Resource. Currently, I do this like so public Resource toResource(Workbook workbook) { var outputStream = new ByteArrayOutputStream() …
Antonio Dragos
  • 1,973
  • 2
  • 29
  • 52
2
votes
1 answer

Using Apache POI from Eclipse Orbit in Eclipse bundle

I am trying to use Apache POI 4.1 from Eclipse Orbit Drop R20200831200620. This is what the relevant piece of MANIFEST.MF looks like: Require-Bundle: org.eclipse.emf.edit.ui, org.eclipse.equinox.registry, org.eclipse.swt, org.eclipse.ui, …
2
votes
1 answer

How to add a first page footer different from default one in NPOI - Docx?

I'm generating a docx file using NPOI 2.5.2 and I stuck with headers/footers for first page. I'd like to have a first page custom footer and start numbering pages from the second one. Here is my code for the first page footer: // First…
tibe
  • 66
  • 3