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.
9,259
questions
0
votes
0
answers
17
views
Apache Poi - XWPF: Is there a way to add a blank Header/Footer on a specific page (other than the first page)?
My document has Title page (First page) and a Table of Contents (Second page). The requirement is to not have a footer on those two pages only, and the rest will get a footer.
As per ...
0
votes
0
answers
31
views
How to upload a big excel with merged cells to springboot api and save only a selected data from it to database
I have got an excel which I need to upload to an API using java, spring boot. The excel has many merged cells in it. It is a huge file of more than 2 MB. While uploading, I need to save some (not all, ...
1
vote
1
answer
23
views
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);
...
0
votes
1
answer
30
views
How to import multiple image into Excel by Java POI
Is there any way to import multi picture and text into a cell of excel?
I'm using Java POI.
This is
my expected result
0
votes
0
answers
44
views
How to write data in excel drop down list in java?
There is City drop down on cell A1 and I want to select the New York value that is in the list.
When I try to write the New York value in the cell A1, cell is getting changed to normal cell that is ...
0
votes
0
answers
29
views
Reading excel cell value and storing the characters of the cell value into an array
I am working on automating some excel task and need to compare two cells. the problem is that the cells I want to compare have different naming systems as the data comes from 2 different systems. For ...
0
votes
0
answers
37
views
How to write data into a given excel sheet
Today i'm trying to write into a given excel sheet. Im using Java and apache poi. I want to write data into a given excel sheet. It's mean im trying to override lots data on the given sheet.
Here is ...
0
votes
0
answers
22
views
How to improve upload time of a spreadsheet in memory (XSSFWorkbook) using apache POI
We got a lambda based app which uses a spreadsheet (10MB size) and we are getting some issues due to the time it takes to load the spreadsheet in memory. For managing excel files we are using Apache ...
0
votes
0
answers
21
views
Apache POI XWPF Increasing the number of pages when adding a new section
Good day Community!
There is a problem after running the code that is specified in the response in the request:
Apache POI - Add page to docx without header
According to the recommendations, a section ...
1
vote
0
answers
26
views
Issues resolving dependencies while reading excel file in groovy
I have a pipeline where i am trying to read an excel file,using shared library feature in jenkins, since its excel am trying to use apache poi package to read, but am unable to read it, can anyone ...
0
votes
0
answers
24
views
AWS Lambda performance initializing takes long due to required file (XSSFWorkbook excel instance) upload time
AWS Lambda initialization issue:
We got an app (lambda based architecture) that uses an excel Spreadsheet (10MB size) which is loaded using apache POI XSSFWorkbook instance. Here what we have tried:
...
1
vote
1
answer
31
views
Apache POI - Excel - File->Passwords->"Read-only recommended" (How to disable)
I have several xlsx files that have the "read-only recommended" flag set.
Is there a POI 5.x method available to disable this checkbox?
I looked through POI XML Properties with no luck.
0
votes
1
answer
36
views
Add dynamic footer in MS Word using Apache POI - Java
Could someone please explain how to insert dynamic footer in each page using Apache poi API - e.g. timestamp & Page Number
2
votes
0
answers
36
views
Implement Java class using JPype and pass it as a parameter
I use Apache POI and JPype together to handle some Excel files. I would like to implement a custom Excel formula function to handle an additional logic in Excel formula evaluator.
It is possible by ...
0
votes
0
answers
25
views
What is AnotherVO, is it from POI?
I was looking for a way to read and edit docx file using java and found an answer with code from this link Editing Word Document using Apache POI
and there is a part of code from the answer
public ...
0
votes
0
answers
16
views
How to overwrite workbook file with Apache POI?
My code is as simple as below. I just create a xlsx workbook, save it to a file. Then I reopen it from the file, make some changes and try to overwrite it.
Workbook wb = new XSSFWorkbook();
wb....
0
votes
1
answer
41
views
while adding poi -ooxml dependency in sts4 I am getting an error - cannot transfer
I am getting an error while adding poi - ooxlm dependency in my Rest assured project . I need to add Excel file interaction to handle data .
The error I am getting is "Could not transfer artifact ...
0
votes
0
answers
43
views
java poi export Excel use Header, but show garbled characters with Chinese word
export excel with Header(return XSSFOddHeader),transform to PDF,it show me the mess code when i input Chinese.
I tried to transform the stirng encode and set the response header and contenttype,but it ...
0
votes
0
answers
50
views
Apache poi 5.2.2 - XWPFRun setText() error
I used Apache poi 4.1.2 and everything worked well .
I tried the same code with the new version of Apache poi (5.2.2)
and the error occurs when I use run.setText()
fun function(){
val document = ...
0
votes
2
answers
64
views
POI single vs multithreaded performance
I have a pretty simple use case - read an Excel spreadsheet with POI, populate some values, run cell updates and retrieve calculation outputs.
What puzzles me is performance. If I run single-threaded, ...
0
votes
1
answer
53
views
apache poi: remove and create a comment for the same cell - Multiple cell comments in one cell are not allowed
I use in my java application the apache poi library version 4.1.1.
I have a method to set a cell comment that is called in various places in my application.
protected void setCellComment(final ...
-1
votes
0
answers
25
views
CSV file covert into Excel using Java Apache poi [closed]
I have two CSV files with data I already have Apache poi dependency in pom. Help me to conver these two file in 1 workbook with different sheets
0
votes
0
answers
36
views
how to correctly place each row in excel with apache POI?
I have an arraylist of x elements, which should be treated with jsoup, after the treatment they should be stored in an excel file but when I try to save them it only stores the last element of the ...
-1
votes
1
answer
45
views
Remove the margins in the header using Apache POI in Java
I am using Apache POI version 4.1.2. When, I try to create a document with an image in the header, there is some default margins allocated for the header on the 4 sides of the image.
How can I remove ...
0
votes
0
answers
27
views
Can I digitally sign VBA code project using Apache POI?
According to the upcoming changes with VBA sign (required by Microsoft) we have to be able to sign VBA Project with Apache POI. I was unable to find any information about this topic. Is it possible?
-3
votes
0
answers
30
views
Write to Apache POI excel from spark dataset
I am new to spark and I am trying to use Apache poi to create reports in Excel with spark dataset in Java.
Any suggestions will be helpful to me.
Thanks in advance.
0
votes
1
answer
28
views
POI after delete rows Excel opens at bottom
I have a requirement to add data to an excel file containing macros.
I am using the following code after adding data using Apache POI(4.1.2) to delete excess rows in the Excel template and create a ...
1
vote
1
answer
61
views
Java ERROR: package X is declared in the unnamed module, but module Y does not read it
I am trying to make my javafx project to create an Excel file. One of the first steps for it would be XSSFWorkbook workbook = new XSSFWorkbook(); for which to work I need import org.apache.poi.xssf....
0
votes
1
answer
46
views
When selecting a cell in excel sheet it becomes black
I am generating excel sheets using Apache POI. When selecting a cell to edit the background of that cell becomes black. I have shared my code and a screenshot of the excel sheet. I didn't set the ...
0
votes
0
answers
19
views
Converting docx to pdf in java [duplicate]
I am using below code-
The external dependency used are -
I am getting the error below as -
{
"timestamp": "2022-05-11",
"message": "Handler dispatch ...
0
votes
0
answers
74
views
sxssf-workbook-createsheet-fails-on-linux-environment (OEL 8.5), Solaris 11.4
SXSSFWorkbook workbook.createSheet() method fails on a linux-environment(OEL 8.5) without throwing any kind of meaningful error (it's just hanging).
Strangely, the same method on the XSSFWorkbook ...
1
vote
1
answer
46
views
Use encapsulated module in non modular Servlet based web app
I have an existing Java web app based on Servlets. It's an Eclipse project and it runs in Tomcat 10.
The application doesn't use any Java 9+ modularization / JPMS up to now. The code base started at ...
0
votes
1
answer
28
views
Apache Poi: Overflowing Text
I'm using apache poi 4.1.2 to write an xlsx file.
I would like to be sure that every text overflows its cell.
The image shows the desired result.
My code:
package poisamples;
import java.io....
0
votes
0
answers
44
views
Apache POI: Data is not visible in XLSX after updating POI version from 3.10 to 5.2.2
I was updating POI library from 3.10 to 5.2.2 after reported vulnerabilities in previous version.
I updated all the functions, classes according to the documentation and after all the changes .xlsx ...
0
votes
0
answers
62
views
Why am I still getting OOM errors with Apache POI using SXSSFWorkbook?
We were using the XSSFWorkbook class to build an excel report, but began getting OOM errors as the included data increased. I've updated the code to make use of the SXSSFWorkbook class instead as I ...
1
vote
1
answer
62
views
Apache POI: default Excel cell styles
Is there are a way to use default Excel cell styles (see below) in Apache POI, similar to default data formats in BuiltinFormats?
0
votes
1
answer
57
views
Excel file gets corrupted after launching an executable jar
I have an Eclipse project with the following code that uses Apache POI.
public static void main(String[] args){
try{
XSSFWorkbook sourceWorkbook = new XSSFWorkbook("input.xlsx");
...
1
vote
1
answer
82
views
I want to write data into excel(.xlsx file) using Apache poi
I want to write data into excel(.xlsx file) using Apache poi. but getting some error while writing a data. I have followed this video " How to read/write data from Excel file using Apache POI API ...
0
votes
0
answers
29
views
Please guide: I want to use payload variable created in excelutility class to another java executable class
Trying to use payload variable extracted from an excel sheet in another executable class where I want to post the payload on MQ, although not able to access the variable. How can I use this variable ...
0
votes
1
answer
37
views
can't complete the cell borders in apache poi
I am putting borders in styling our excel file. I'm using propertyTemplate of Apache POI.
I tried to change the numbers, but I can't successfully fill the borders. There's still gaps. It looks like ...
-1
votes
0
answers
35
views
Editing existing Microsoft excel files using Apache Poi for Android Apps within Storage Access Framework (Kotlin)
I want to open and edit Microsoft Excel files for my android app.
Here is the code I wrote.
@Composable
fun FileSearchButton() {
val context = LocalContext.current
val launcher = ...
1
vote
1
answer
50
views
How can I suppress the initial StatusLogger error message
I am using Apache POI 5.2.2 in my application. Apache POI is using log4j2 as it's internal logging mechanism for debugging. As a result log4j-api-2.17.2.jar is a required dependency. I should note ...
0
votes
1
answer
25
views
setCellStyle not applicable
I've been styling our excel file that could be downloaded when needed. What I have tried:
CellStyle style = workbook.createCellStyle();
style.setFillForegroundColor(IndexedColors.AQUA.getIndex());
...
-1
votes
0
answers
19
views
apache poi add styles like setColor, setFontFamily etc ( to 2 different markers )
hello I'm new to apache poi, I have some problems, I would like to add types of styles to 2 different types of marker,
Here I show a part of my code where I only put a stylo in general. how would you ...
0
votes
0
answers
31
views
Is it possible to read all the data from a docx file using apache poi?
I mean, I know that is possible to read paragraphs, tables and other types of data a docx might have, but is it possible to read this data in sequence?
I have a word docx document that has paragraphs, ...
0
votes
0
answers
53
views
Apache POI - access and modify custom fields
I'm working with apache POI.
Is it possible to define so called custom fields (see Quickpat menu) with apache POI?
I'm using objects of type XWPF to access docx files since my program.
I haven't found ...
0
votes
1
answer
28
views
How correctly write JSON string into CVS/XLSX cell?
I have an array of objects in JSON
[{"id":"1","name":"Name1","identity":"Identity"},{"id":"2","name":"...
0
votes
1
answer
58
views
How to use Low Level CTRPr & CTPPr Classes of latest Apache POI 5.2.2
I am upgrading to latest POI 5.2.2 from POI 3.14. Currently I am using below mentioned low level classes in Apace POI 3.14 which needs to be updated.
i)CTRPr - to set/get run props like bold, italics, ...
0
votes
1
answer
68
views
Why STOnOff Enums are removed in Apache 5.2.2 ? How to set X_0 & X_1 values?
I was using STOnOff.X_0 Enum to set value as 0(i.e false) for some elements in Apache POI 3.14 when constructing docx file. But now currently in latest version 5.2.2, I could this class has been ...
0
votes
1
answer
31
views
Apache POI incorrectly printing cell that is auto formatted to time
I am trying to print out a cell from an encrypted Excel workbook. The cell contains a time and when i try to print cell.getNumericCellValue(), the result is a random number, that seems to be dependend ...