Questions tagged [xssf]

XSSF provides Java APIs to read / write Microsoft Excel 2007 (OOXML format .xlsx) files. This tag should be used for questions about accessing Excel 2007 files from Java applications. XSSF is managed under the Apache POI Project. Other tag to consider: [tag:apache-poi]

HSSF is the POI Project's pure Java implementation of the Excel '97(-2007) file format. XSSF is the POI Project's pure Java implementation of the Excel 2007 OOXML (.xlsx) file format.

If you are starting with Apache POI, you may find the Busy Developer's link very useful: http://poi.apache.org/spreadsheet/quick-guide.html

Useful links

488 questions
58
votes
8 answers

Apache POI error loading XSSFWorkbook class

I'm trying to write a program that works with Excel docs, but the HSSF format is too small for my requirements. I'm attempting to move to XSSF, but I keep getting errors when trying to use it. I managed to solve the first two by adding…
Cameron Zach
  • 581
  • 1
  • 4
  • 4
57
votes
8 answers

How to load a large xlsx file with Apache POI?

I have a large .xlsx file (141 MB, containing 293413 lines with 62 columns each) I need to perform some operations within. I am having problems with loading this file (OutOfMemoryError), as POI has a large memory footprint on XSSF (xlsx)…
CosmicGiant
  • 6,275
  • 5
  • 43
  • 58
40
votes
9 answers

Processing large xlsx file

I need to auto-fit all rows in large (30k+ rows) xlsx file. The following code via apache poi works on small files, but goes out with OutOfMemoryError on large ones: Workbook workbook = WorkbookFactory.create(inputStream); Sheet sheet =…
miah
  • 8,190
  • 2
  • 24
  • 23
30
votes
3 answers

Java POI the supplied data appears to be in the Office 2007+ XML

I am getting this error: org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of…
Marco Dinatsoli
  • 10,322
  • 37
  • 139
  • 253
24
votes
1 answer

HSSFWorkbook vs XSSFWorkbook vs SXSSFWorkbook - Apache-poi

HSSFWorkbook vs XSSFWorkbook and the advantages/disadvantages of XSSFWorkbook and SXSSFWorkbook?
Sedat Polat
  • 1,631
  • 2
  • 18
  • 28
23
votes
6 answers

Issues resolving XSSFWorkbook - Java - POI .jar

I'm trying to do work upgrading a Java application to handle .xlsx, using a newer POI library than our existing one. I'm having issues similar to those mentioned in the comments to the answer here: Apache POI, using both XSSF and HSSF I'm pointing…
Nick
  • 231
  • 1
  • 2
  • 3
20
votes
2 answers

XSSFCellStyle setFillForegroundColor and setFillBackgroundColor doesn't work

I tried to use setFillForegroundColor and setFillBackgroundColor to change the cell color of an excel file. However, I failed and I really didn't know what the problem was. I've googled for many hours and still couldn't find the right way to set…
Brian
  • 12,145
  • 20
  • 90
  • 153
19
votes
8 answers

Apache POI XSSF reading in excel files

I just have a quick question about how to read in an xlsx file using the XSSF format from Apache. Right now my code looks like this: InputStream fs = new FileInputStream(filename); // (1) XSSFWorkbook wb = new XSSFWorkbook(fs); //…
Andrew
  • 191
  • 1
  • 1
  • 3
19
votes
1 answer

Auto wrap in apache POI (Excel)

I have a java program which takes header and data as the input and produces an excel file. However, sometimes when the header values are long and the number of columns are more, my excel sheet tends to be unnecessarily wide. Because of the…
Vicky
  • 16,679
  • 54
  • 139
  • 232
17
votes
4 answers

How to get the last column index reading excel file?

How do i get the index of the last column when reading a xlsx file using the Apache POI API? There's a getLastRowNum method, but I can't find nothing related to the number of columns... EDIT: I'm dealing with XLSX files
marcosbeirigo
  • 11,098
  • 6
  • 39
  • 57
17
votes
2 answers

Excel Drop down list using Apache POI

I need to create a drop down list in excel file using Apache POI. and I am able to do that so But I am not able to make first item in drop down list as default Item. public class sd { /** * @param args * @throws IOException */ public static…
Vineet
  • 861
  • 2
  • 7
  • 6
15
votes
4 answers

Limitation while generating excel drop down list with Apache POI

I'm trying to generate an excel file with some validations, I've read the poi dev guides for implementing it. During implementation, I got an exception (String literals in formulas can't be bigger than 255 characters ASCII). POI concatenates all…
Jama A.
  • 15,680
  • 10
  • 55
  • 88
14
votes
5 answers

java.lang.ClassNotFoundException: org.apache.poi.xssf.usermodel.XSSFWorkbook

when i tried to create a workbook in normal java class it is creating but when i tried to run the same on servlet it is throwing exceptions Normal java class import java.io.File; import java.io.FileInputStream; import…
Rajasekhar
  • 787
  • 6
  • 13
  • 31
12
votes
6 answers

Convert csv to xls/xlsx using Apache poi?

I need to convert csv to xls/xlsx in my project? How can i do that? Can anyone post me some examples? I want to do it with Apache poi. I also need to create a cell from java side.
v0ld3m0rt
  • 866
  • 3
  • 12
  • 47
11
votes
4 answers

xssf How to get anything as String

I try to parse an excel file into XML using apache poi xssf. Now having a cell and not knowing what is in it I just want to get a String out of it. But when I use cell.getStringCellValue() it throws an exception, what is not very suprising since it…
mxcd
  • 1,954
  • 2
  • 25
  • 38
1
2 3
32 33