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

Is it possible to read the data from different sheets in a same xlsx file?

i am using the Apache POI to read an xlsx file. i can able to read the Sheet1 data. But when try to read the Sheet2 i am getting the Sheet1 data only. String strPath = "..\\Test.xlsx"; File excelFile = new File(strPath); …
ASHOK
  • 23
  • 2
2
votes
0 answers

Import Excel file via JPA Spring boot

I need to import data from an Excel file to a MySQL database to fill a table by this entity. I have prepared a html file (thymeleaf), I have my class and I created the repository to save new entities, but when I try to import from an Excel file I…
2
votes
1 answer

Issue with export CrossTab data into excel sheet using Java Apache POI 3.15 version

I am collecting data from my company portal and trying to export it into an excel sheet. I successfully completed for non-crosstab report data. But the issue is coming when the data has crosstab. Data: I have saved in data in ArrayList best on my…
Neel
  • 233
  • 5
  • 18
2
votes
1 answer

Merging Excel files into single workbook

I have a requirement to copy all the individual excel files to one single workbook separated by tabs where I'm using ASPOSE API. But its a paid one. I have seen another API's which is cell-to-cell copying but its consuming time. I don't find any API…
Manju
  • 199
  • 1
  • 2
  • 10
2
votes
1 answer

Implement memory efficient XLSX reader in JAVA using poi with XSSF and SAX but didn't know how to get formula?

I am trying to implement .xlsx a reader using POI in java in that my main concern is the memory so I implemented it using XSSF and SAX here is the reference for code which I use Event API (XSSF with SAX) but the formula is one of the main things…
Umesh Sonawane
  • 517
  • 6
  • 17
2
votes
2 answers

Apache POI throws exception while reading xlsx file in Linux enviroment

I am using the latest version of Apache POI at this moment which is 4.1.1. Every thing is working fine for xls file. Even for xlsx file in development environment Windows. But I am getting exception in live environment Red Hat Linux. I have already…
Moshiur Rahman
  • 347
  • 2
  • 8
2
votes
0 answers

selecting multiple values at once from the drop down list in a cell of an excel sheet using Apache Poi

I want to write a code to populate a restricted excel sheet in which all the cells in excel must only contain the allowed values as drop down list ( as checkboxes i.e user can select more than one value from the drop down list to fill the excel…
2
votes
1 answer

The method setFillForegroundColor(short) in the type CellStyle is not applicable for the arguments (XSSFColor)

I am trying to get custom colours to work in Apache POI but I got into a small problem. So far I have been using IndexedColors, but as a palette, it is pretty drab. Thus using an RGB format for colour selection would help me to make my spreadsheets…
JoffJoff
  • 145
  • 1
  • 12
2
votes
1 answer

Mapping of Apache POI HSSF/XSSF to XLS/XLSX

Apache POI 4.x here. I see there are two types of Workbook implementations: HSSF Workbook XSSF Workbook I need to write a Java 8 app that reads Excel sheets with either ".xls" (XLS) or ".xlsx" (XLSX) extensions. Meaning, Excel files that were…
hotmeatballsoup
  • 385
  • 6
  • 58
  • 136
2
votes
0 answers

Poi ans Xerces:exception on windows

I have a Spring Boot/Maven/Java 8/Tomcat 8.5 webapp which works with docx files. On Mac it works fine, but on Windows i get weird exceptions. I've tried in both environments with the same input data and got different output. On mac I got what I…
mgu
  • 67
  • 1
  • 7
2
votes
3 answers

Getting date in double format 43318.4847916667 instead of 06-08-2018 11:38:06

I am writing a java code to generate an excel file using HSSFWorkbook(.xls). I need to write date in one column in this format 06-08-2018 11:38:06 but it is generating like this 43318.4847916667. Here is the code snippet i used. Please help me how…
Anam Qureshi
  • 161
  • 2
  • 8
2
votes
1 answer

Can XWPFDocument be converted to a Byte[] without saving it to a file first?

is it possible to convert a XWPFDocument to byte[]? I don't want to save it into a file because I don't need it. if there is a possible way to do it, it would help
SH A
  • 95
  • 1
  • 9
2
votes
0 answers

How do I change the ZipSecureFile.setMinInflateRatio() in the ConvertToExcel Nifi Processor?

I am trying to ingest Excel files (.xlsx) and part of my Nifi flow (the second step) utilizes the preconfigured ConvertExcelToCSV Nifi processor, however, some of the Excel files set off the Zip Bomb detector since they are over the default…
Noah Brace
  • 21
  • 2
2
votes
5 answers

How to open .xlsx files with POI SS?

I am trying to open .xlsx files with POI SS with this code (taken from http://poi.apache.org/spreadsheet/quick-guide.html#ReadWriteWorkbook): InputStream inp = new FileInputStream("workbook.xls"); //InputStream inp = new…
Yoni
  • 553
  • 3
  • 14
  • 24
2
votes
1 answer

How to set cell type as string in Apache POI XSSF 4.10?

I'm trying to set the cell value as String using Apache POI XSSF 4.10 . I have used the code sheet.getRow(i).getCell(k).setCellType(CellType.STRING); but it throws null pointer exception. Please help
Diksha Baluja
  • 81
  • 2
  • 10