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

IRR in poi return NaN but correct value in excel

When i calculate Irr value use apache/poi i get Double.NaN, but the same inputs in excel i got a negative value. So why they return different value? inputs…
Bo.hai
  • 63
  • 8
2
votes
1 answer

How can add different colour for each worksheet in excel using Apache POI

When you have multiple worksheets in a workbook, you usually click on a sheet's name at the bottom of the page to view it. My question is then to know, if that "button" containing the sheet's name can take a color such as blue, green and so on. …
shivani yadav
  • 19
  • 1
  • 9
2
votes
0 answers

Apache POI ClasDefNotFoundException when in fat jar compiled with Maven

I had a pom.xml that was previously working, creating a fat .jar library with all the dependencies I need inside of it. Then I needed to use the library Apache POI, then I added this to my pom.xml org.apache.poi
lispguy
  • 105
  • 2
  • 10
2
votes
2 answers

java.lang.UnsupportedOperationException: null

I am trying to delete empty cell in apache-poi. I get this error at unmarkedColumns.remove(unmarkedColumns.get(i)): There is a problem with remove method. I don't understand why.Can you help me? java.lang.UnsupportedOperationException: null at…
user9413194
  • 119
  • 2
  • 3
  • 9
2
votes
0 answers

Apache POI : Add images to the header of excel files

I am using Apache POI 4.1 to generate Excel reports. I have a requirement to include logo image as Header event in Sheet. I could find the only below code, which adds text in Header. Is there any way to include image in the Header section of…
shihabudheenk
  • 593
  • 5
  • 18
2
votes
1 answer

How to convert an apache poi workbook to a spark dataframe?

I am reading a blob of an excel file from the database. Each file contains only one sheet in it. Using Apache poi I am converting it into a workbook like below. val wb = w.getWorkbook(blob) Now I want to convert it to a spark dataframe to process…
2
votes
1 answer

Apache POI: How do I set the dataFormat of a cell based on a Java DateTimeFormatter

I need to export date and time data to Excel, using the format specified on the host OS. The only way I've found to get this format in Java is by using DateTimeFormatter. I then need to set the data format of the Excel cell using Apache POI. How do…
2
votes
1 answer

Unable to read all content in order of a word document (docx) in Apache POI

I've been trying to read all content (including tables, pictures, paragraphs) from a word document. I'm able to read tables and paragraphs using getBodyElementsIterator() but it doesn't read pictures present inside the document. Although I'm able…
Devanshu
  • 21
  • 2
2
votes
1 answer

Is there a way to get speaker notes accurately from a given PowerPoint file with Apache poi?

I'm trying to transfer speaker notes from one powerpoint to another using apache poi, and I can't get an accurate transfer. After looking around a bit, I couldn't find many resources. I did find this link: How to get pptx slide notes text using…
ML72
  • 145
  • 1
  • 8
2
votes
2 answers

Is there a way to mock getCTTbl().getTblPr().getTblBorders().getBottom().setColor()?

I have written a class that writes data into a word document. Now I have to write mockito tests for my class. My problem is that I don't know how to mock getCTTbl().getTblPr().getTblBorders().getBottom().setColor() on a mock table. this is part of…
2
votes
1 answer

Copy row formula with range in excel

I'm creating an application in which I'm generating an excel sheet after some inputs from the user. If user enter 5 records, I'm coping the initial/first row(cells with formulas) and then inserting each values in cells. The problem is after coping…
Nirmal Prajapat
  • 1,735
  • 1
  • 12
  • 23
2
votes
1 answer

Apache poi - adding a new page in existing .xlsx file

There is a script to test the product listing page. During this script, the data from the web page (in the form of two List with the name and price) should be transferred twice to the .xlsx file, each time to a new sheet. The problem is that the…
Yoooo
  • 89
  • 6
2
votes
1 answer

Is Event model of POI API not applicable(getting compilation error) in version 3.15?

I have implemented a program where I am trying to read an excel file(.xlsx) using SAX and XSSF(POI API) with the jar version 4.1 where it works alright. But it gives compilation error in POI version 3.15. The code looks some thing like this(which…
DockYard
  • 989
  • 2
  • 12
  • 29
2
votes
1 answer

How to fix error while opening Excel using Apache POI. Error say "We found a problem with some content in xyz.xlsm. Do you want..."?

I am using Apache POI and Java 8 to generate excel from a existing template which has multiple sheets in it. This is a simple JavaFX based Desktop application which reads the excel file template and deletes sheets based on user input. For some…
kula sekhar
  • 107
  • 1
  • 6
2
votes
1 answer

How to Use Apache POI to create excel hyper link that links to long url

Excel is having a hyper link size limit of 255. Now I'm using Apache POI to programmatically fill in a excel, but with a s3 pre-signed url that is much longer than 255 characters, 1350+ in length. And when I click the hyper link created in excel,…
james
  • 191
  • 3
  • 9
1 2 3
99
100