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

Multiple connectors between Apache POI shapes

Recently i am working with Apache POI with Spring Boot and i am facing an issue. I want to represent database connections between entities, and i have a problem with visualizing multiple connections. So the basic problem of mine is separating…
Lorin
  • 21
  • 3
2
votes
0 answers

Problems reading xlsx file with apache-poi

I have a strange error reading an xlsx file, on my windows computer I have no problem, instead on heroku it gives me the following error: unable to parse shared strings table. Obviously the file I try to read is the same. My code: private fun…
Alessandro
  • 33
  • 5
2
votes
1 answer

Center and bold the contents of table cells in Apache POI Word document

How can I center and bold the content of the table cells using Apache POI in a Word document? This is the code I use to build the table: XWPFDocument document = new XWPFDocument(); XWPFTable table = document.createTable(); XWPFTableRow tableRowOne…
Hareesh
  • 43
  • 1
  • 5
2
votes
0 answers

Pdf result is wrong format

I need to convert a docx in `pdf. This is the starter docx: The document docx has something like a table border and other table ( in the docx at the end , belove the two fields, there are a lot of rows with black border). Another problem is that…
JoeB
  • 201
  • 2
  • 4
  • 9
2
votes
4 answers

java.lang.IllegalAccessError: superclass access check failed: class org.apache.poi.openxml4j.util.ZipSecureFile

I tried to read and write excel files using org.apache.poi. I get the following exception when I try to access an xlsx file using XSSFWorkBook Exception in thread "main" java.lang.IllegalAccessError: superclass access check failed: class…
Roshana
  • 357
  • 1
  • 3
  • 17
2
votes
0 answers

How to auto-size height of merged rows in HSSFSheet?

I have a merged rows inside HSSFSheet And I trying to set row's height automatically this way: borderedStyle.setWrapText(true); row.setHeight((short)-1); whole code is here…
2
votes
1 answer

Apache POI SXSSFWorkbook write around 500.000 in XLSX file Memory issue

We developed an application using Spring Batch and Apache POI to read data from DB(Oracle) and write it into a XLSX generated file from apache-poi. There is a job with reader (read data from DB ItemReader) and writer (ItemWriter) below the…
2
votes
1 answer

Could not resolve external workbook name 'excel_file_name.xlsx'. Workbook environment has not been set up

My Spring Boot project using Apache Poi to read data from excel file. i use FormulaEvaluator to calculate the value of cell FormulaEvaluator formulaEvaluator =…
Tung Vo
  • 2,227
  • 5
  • 27
  • 45
2
votes
1 answer

Apache POI set cell border is not working

I'm facing an issue with Apache POI (v 4.1.2) where it can't set the border as THIN. My code is supported for both XLS and XLSX extensions. When I export data to XLSX file, everything is OK, but with XLS files, it doesn't draw the border from cell…
Van D LE
  • 23
  • 1
  • 7
2
votes
1 answer

Copying and mutating row in a .docx table

I am using Apache POI to process .docx file. I have .docx with 1 row, 1 column table. XWPFTable table = document.getTables().get(0); XWPFTableRow copiedRow = table.getRow(0); table.addRow(copiedRow); The above code successfully copies the row, so…
weno
  • 804
  • 8
  • 17
2
votes
2 answers

Apache POI: ${my_placeholder} is treated as three different runs

I have a .docx template with placeholders to be filled, such as ${programming_language}, ${education}, etc. The placeholder keywords must be easily distinguished from the other plain words, hence they are enclosed with ${ }. for (XWPFTable table :…
weno
  • 804
  • 8
  • 17
2
votes
3 answers

How to write csv file on the basis of Excel using java?

I have spreadsheet with certain data. I would like to programmatically dump this to CSV file. How can I do this using java?
Sameek Mishra
  • 9,174
  • 31
  • 92
  • 118
2
votes
2 answers

JXLS 2.0 Conditional Formatting Forumla not updated per row

Trying to create an JXLS excel template where it should be possible to copy conditional formatting from a cell on a specific row to the next generated row. In the template, I create my formatting. If the value in the cell is equal to "yes" the row…
Jonathan Andersson
  • 1,342
  • 3
  • 16
  • 31
2
votes
1 answer

How to export an OpenFaces DataTable in Excel/CSV Format?

Unfortunately, OpenFaces Datatable has not yet an export capability unlike Primefaces or IceFaces. While Exporting is a piece of cake, filtering an IceFaces or primefaces datatable is less easy, Yet primeFaces's filtering does not work with JSF…
Hanynowsky
  • 2,970
  • 5
  • 32
  • 43
2
votes
3 answers

java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook

java.lang.NoClassDefFoundError:org/apache/poi/hssf/usermodel/HSSFWorkbook This is java web project. The java project is ok, but in web, I got this exception. Caused by: java.lang.ClassNotFoundException: org.apache.poi.hssf.usermodel.HSSFWorkbook at…
link
  • 29
  • 1
  • 1
  • 4