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
0 answers

POI: Excel double click changes the date format

I am facing one strange issue. I have written a program in java using apache poi 5.2.2 which reads csv file and writes in to excel sheet(.xlsx).In that csv file there is one date column, the format is in mm-dd-yyyy(04-25-2022). my program converts…
Prashant Naik
  • 105
  • 1
  • 8
2
votes
1 answer

XSSFWorkbook error - Mostly missing some Jar or Dependencies

I am not using Maven, this is a standalone project where i provide the jars in Reference Libraries The error is thrown when the code is trying to initialize the workbook workbook = new XSSFWorkbook(); Error : ERROR StatusLogger Unable to create…
2
votes
1 answer

Not able to add bullet points and styles like bold and italic for some portion of a line using Apache POI

I'm reading one string in that some li tags have spans with styles so I'm trying to add styles for a particular word in the li tag (not for the whole line), but for every styles change it is going for new bullet point instead of appending to the…
2
votes
4 answers

Not able to read xlsx file saved in postgres database (as bytea) using apache POI

I am using apache POI to read a xlsx file and upload the data in the database. I have to do this work in a scheduler(at scheduled time) running on Jboss. As scheduler is running on different server from the one file was uploaded, I am using postgres…
Amit
  • 133
  • 9
2
votes
2 answers

Just want to put up image directory to excel but keep getting NullpointException with following error

What im trying to do here is to find .txt file, draw some text out, asign it to its respective cell on excel and then from same folder, bring image directories and asign it to next sheet of same excel workbook. The first part went well with method…
Arpan
  • 45
  • 9
2
votes
1 answer

Setting axis title and adding values to the bar

I need to change the properties (like size of font) of the title axis (circled in red) I'm using the apache-poi library and here's the part of the code which generates both titles XDDFCategoryAxis bottomAxis =…
dcm50
  • 103
  • 3
  • 13
2
votes
0 answers

Android Filesystem Permissions and POI

I am trying to read an Excel file in the documents folder (/storage/emulated/0/Documents/). I have gotten the Apache POI library included in my project, and it builds and runs. Upon opening the relevant activity, I run…
Robert
  • 47
  • 6
2
votes
1 answer

Apache Poi - XWPF: How to change font color, size, style of the footer Page Number in docx

I have tried the code below, but it seems that setColor() only updates the text in the paragraph -- it does not affect the color of CTSimpleField Page Number. CTSectPr sectPr = getSectionProperty(0); CTHdrFtrRef footerRef =…
fidilen
  • 25
  • 4
2
votes
2 answers

Identify hidden text Word 2003/2007 using Apache POI

I am converting a Word (2003 and 2007) document to HTML format. I have managed to read the text, formats etc from the Word document. But the document contains some hidden text like 'Header Change History' which need not be displayed on the page. Is…
Albin Joseph
  • 1,020
  • 3
  • 16
  • 25
2
votes
1 answer

Cell style is lost or not displayed in Excel 97-2003 (.xls)

I am using the Apache POI library to export data to Excel. I have tried all the latest versions (3.17, 4.1.2, and 5.2.1). I have a problem with Excel 97 (.xls) format in relation to cell styles. The cell style somehow is lost (or not displayed)…
Hoang Ngo
  • 23
  • 3
2
votes
1 answer

Java Apache POI Bug

While working with the Apache POI Implementation I ran into a strange behaviour. I cannot explain the cause, so if anybody can give some hints, I would love to hear them. It is not even a big blocker for the problem that I was solving - at this…
Matze
  • 325
  • 1
  • 12
2
votes
1 answer

Exception in thread "main" java.lang.NoSuchFieldError: Factory question

I'm trying to test a xml to excel converter in Java and I have the following exception Exception in thread "main" java.lang.NoSuchFieldError: Factory at org.apache.poi.xssf.usermodel.XSSFWorkbook.onWorkbookCreate(XSSFWorkbook.java:475) at…
2
votes
1 answer

Error with xlsx file in android studio using Apache poi

With what that error can be connected: org.apache.poi.ooxml.POIXMLException: error: The 'namespace-prefix' feature is not supported while the 'namespaces' feature is enabled. ? I'm just trying to understand to how can I work with Excel file and that…
aDragon
  • 21
  • 3
2
votes
1 answer

Missing XSSFWorkbook even after using Maven dependency poi-ooxml

Let me start by saying that I have seen a lot of questions regarding the error XSSFWorkbook cannot be resolved to a type. However, I have looked into most of them, and the accepted answer seems to be to add the Maven dependency poi-ooxml. Indeed,…
Jak
  • 178
  • 10
2
votes
1 answer

How to specify file name for a download done via POST in akka http

The user sends a post request, than based on that post body I create an Excel file (.xlsx) and want to send that file back, without storage of that file itself. def writeAsync(out: OutputStream): Unit = { Future { val wb = new XSSFWorkbook …
MJey
  • 345
  • 3
  • 16