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

Why does Oracle change the physical orders of data while performing a bulk insert?

I have to use Java POI to batch import some excel files into Oracle database. The Java program is very easy, just use JDBC to inert them. But when I checked the table, I found the physical orders of data changed. For example, I import data like…
superleo
  • 319
  • 1
  • 2
  • 10
2
votes
2 answers

How to Use getViewableIterator in POI

I'm currently using POI to attempt to extract text out of a batch of Word documents and I need to be able to determine what entries a document contains. I've been able to get as far as pulling the document root and pulling the first entry but I…
Anne Porosoff
  • 1,931
  • 16
  • 18
2
votes
1 answer

Apache POI extract hyperlinks from word document

Anyone knows how to extract links from word documents using Apache POI? Or even better, from a paragraph?
Ron
  • 393
  • 1
  • 4
  • 13
2
votes
1 answer

POI cell.setCellFormula cause "Name 'MY_FUNC' is completely unknown in the current workbook" error

I want to use POI setCellFormula to set a formula to an cell, the formula is from a excel add-in but not currently installed. After that, I'll move the excel to a PC with the add-in installed to evaluate the formulas. However, when I try to set the…
codeplay
  • 610
  • 1
  • 9
  • 19
2
votes
1 answer

Set page view mode in excel file using apache poi

Excel has different modes for viewing a sheet: Normal, Page Layout, Page Break Preview. (In excel 2010: in the view tab). The view mode is saved seperately for each sheet in a workbook and is restored when opened again. I am trying to find a way to…
EliK
  • 103
  • 1
  • 6
2
votes
1 answer

MAPIMessage's getdate function returning ChunkNotFoundException

I am using apache's poi hsmf to process .msg outlook files. When I try to retrieve date using MAPI's getdate function it throws a ChunkNotFound Exception, I do not know what is going wrong. Here is the code snippet MAPIMessage msg = new…
phntmasasin
  • 765
  • 1
  • 5
  • 14
2
votes
0 answers

p:dataExporter exporting all dataTables instead of just the targeted dataTable component

I am querying data from a database, and presenting the results in a separate for each result. I am using an with multiple to hold this list of results. Each result is under a separate tab, and…
2
votes
1 answer

Apache POI - background colours not as expected

Thanks for looking. Im using Apache POI to read an excel file. I want to use conditional logic that will use background colour. But I don't understand the results Im getting. Why does following code show different results for same…
mryan
  • 382
  • 1
  • 4
  • 18
2
votes
0 answers

how to convert a docx into html

So I have a program that can create a docx file and now I want to implement a code that takes the docx file and converts it into html. I have somewhat made it functional but the problem I'm having is that the converter does not detect the…
apo
  • 43
  • 4
2
votes
2 answers

Any library that have inbuilt methods to get exact page number and line number of an element in word document

I am looking for a library in java that can read all data from a word document element by element including paragraph,tables, charts, images and comments etc. and having the track of current page number and line number where the element is starting…
lemon chow
  • 303
  • 8
2
votes
0 answers

How can we get the current page number and line number of an element in word file

While reading the Word file element by element using the Apache POI library, I need to have a track of current page number and current line number where the element is at? I have used the below code to get element by element: import…
lemon chow
  • 303
  • 8
2
votes
1 answer

Apache POI Error 'unreadable content' When Using addMergedRegion

I am getting the below Excel error when I use addMergedRegion. This is my code: spreadsheet.addMergedRegion(new CellRangeAddress(a+1, b, 1, 1)); The error I get in Excel says that the downloaded file has "unreadable content" and asks if I want to…
2
votes
1 answer

How to set formula in Excel with POI?

I want to generate a Excel sheet with Apache POI. One cell should contain a formula. Unfortunately, it doesn't work. I get an error in the Excel sheet. Code public static void main(String[] args) throws FileNotFoundException, IOException { …
dur
  • 15,689
  • 25
  • 79
  • 125
2
votes
1 answer

Resize Image on workbook sheet does not work in apache poi

i am using newest apache poi dependency and want to resize image (to not have it so so big after workbook opened): org.apache.poi poi
2
votes
0 answers

Apache POI set Heading

I am creating the content of a docx file and try to have headings above tables I create. I currently create the text like that: XWPFParagraph newParagraph = document.insertNewParagraph(cursor); XWPFRun run =…
shtanddwn
  • 33
  • 4