Latest Questions tagged Apache Poi

Browse all latest questions tagged Apache Poi

34
Votes
Published 30 Oct, 2022
Java - Generate a excel using java and create a macro in the excel

I have a java code that takes data from MongoDB and later creates an excel(.xls) containing this data using Apache POI but in a formatted manner. My final requirement is to mail the last worksheet i...

75
Votes
Published 07 Sep, 2022
Java - Apache POI - How to protect sheet with options?

I'm using the Apache POI to generate an Excel File (2007). What I want is to protect the sheet, but with some options enabled. By options I mean the check box list when you try to protect the sheet in...

75
Votes
Published 07 Sep, 2022
Java - Apache-POI sorting rows in excel

I'd like to sort rows in a sheet by one of string column. I tried to achive that using Sheet.shiftRows method, but I cannot manage with that. It doesn't switch positions of rows in my method. What's w...

48
Votes
Published 21 Aug, 2022
Java - Change colors of line chart Apache POI

I've generated a line chart using Apache POI. I need to change the default colors I got in the chart. Can I use RGB codes to define specific colors to each line? My code is as follows. Drawing dra...

77
Votes
Published 04 Sep, 2022
Java - NoClassDefFoundError: UnsupportedFileFormatException while using apache poi to write to an excel file

I am trying to write to an excel(.xlsx) file using Apache poi, I included the apache poi dependencies in my pom.xml file. But I am getting the following exception in execution. Exception in thread "m...

30
Votes
Published 07 Sep, 2022
Java - Issue with poi jar file java.lang.NoSuchMethodError

I am using poi-3.7.jar in my application while i am generating an excel file i am getting the below exception. and i have excluded all the poi jars from my project. could any one help me on this?? j...

47
Votes
Published 19 Oct, 2022
Java - Error when reading values from excel files using Apache POI 4.1.1

I am attempting to read values from an excel file using Apache POI and I am encountering the following error message: org.apache.poi.ooxml.POIXMLException: org.apache.xmlbeans.XmlOptions.setEntityExp...

67
Votes
Published 14 Sep, 2022
Java - Merging cells in Excel using Apache POI

Is there any other way to merge cells in Excel using Apache POI library? I was trying using the following, but its not working // selecting the region in Worksheet for merging data CellRangeAddress...

44
Votes
Published 30 Aug, 2022
Java - Java Excel/POJO Mapping in POI

Java 8 here using Apache POI 4.1 to load Excel (XLSX) files into memory, and write lists of Java beans/POJOs back to new Excel files. To me, an Excel file (at least the ones I'm working with) is real...

69
Votes
Published 16 Sep, 2022
Java - How to detect a zip-bomb with Java 10

Apache POI is opening zip-files on a regular basis because Microsoft Excel/Word/... files are zip-files in their newer format. In order to prevent some types of denial-of-service-attacks, it has funct...

61
Votes
Published 14 Sep, 2022
Java - The method setCellType(int) from the type XSSFCell is deprecated

Which is the alternative to this deprecated code? cell.setCellType(XSSFCell.CELL_TYPE_NUMERIC); //... cell is of XSSFCell type I am using Apache POI 3.17

12
Votes
Published 08 Sep, 2022
Java - Find Excel Cell by Text in Apache POI

I'd like to find a cell in an Excel sheet by its text. The text is something like %t: sheet.findCell("%t"); // pseudo-code, not working My goal is to enable the user to provide kind of template, in...

11
Votes
Published 05 Sep, 2022
Java - Apache POI java.lang.NoSuchMethodError

My code is below: import java.util.*; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.IOException; import org.apache.poi.ss.use...

114
Votes
Published 04 Sep, 2022
Java - How to insert a linebreak as the data of a cell using Apache POI?

I use Apache POI 3.16 to create an Excel file. I want to set the data inside a particular cell to have a linebreak : rowConsommationEtRealisation.createCell(0).setCellValue("Consommation (crédits)\r\...

30
Votes
Published 03 Sep, 2022
Java - Not able to set custom color in XSSFCell Apache POI

I am trying to set some custom(from hexcode or rgb value) color to a xssfcell.But the color of the cell is becoming black even though I am giving some other color.I have tried doing this by the follow...