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
0
votes
0 answers

Invalid header signature; read 0x6D78206C6D74683C, expected 0xE11AB1A1E011CFD0

Invalid header signature; read 0x6D78206C6D74683C, expected 0xE11AB1A1E011CFD0 getting the above error when I am trying to read excel sheet. xls format. when I try to open the sheet manually I get this error : "The file format and extension of…
VidyaSN
  • 11
  • 4
0
votes
1 answer

Freeze/lock an image on xlsx sheet using apache.poi

I'm creating an xlsx using Apache.POI and inserting a logo at the top,how do I freeze or lock the images so that it cant be changed once the xlsx is downloaded. int numberOfSheets = wb.getNumberOfSheets(); for(int…
tyro
  • 765
  • 2
  • 13
  • 34
0
votes
1 answer

The size of an image is different from sheet to sheet in XSSFWorkbook

I'm trying to insert a logo in every sheet of excel below is the code snippet: int numberOfSheets = wb.getNumberOfSheets(); for(int i=0;i
tyro
  • 765
  • 2
  • 13
  • 34
0
votes
1 answer

How to limit heap consumption without setting -Xmx flag

Problem I have an .xlsx file with lots of formulas. I want to transform this file to a new .xlsx file with all formulas replaced with its absolute value. Why? probably not related with this question. What did I do? My target was to perform this task…
Samiron
  • 5,169
  • 2
  • 28
  • 55
0
votes
1 answer

Java Poi XSSF - create pivot table with multiple expandable columns

I have about 1000 rows with multiple columns and I want to create a pivot table out of them. My actual result is: But I want to get a pivot table which looks like this: My current code: // ... // fill sheet with data // ... // create Pivot…
ninjaxelite
  • 1,139
  • 2
  • 20
  • 43
0
votes
1 answer

Trying to read and return a string array with xlsx in Java

Hi I've been trying to read an array using xssf, but every time I attempted to return a string array I always messed up. I know my code is bad and all and I am still learning how to make it work, anyways here is my code and please be nice and…
lifrah
  • 27
  • 4
0
votes
1 answer

Is it possible to set the active range with Apache POI XSSF?

I am using Apache POI XSSF to read and write Excel Sheets. I know that I can set the active cell on a worksheet by using Sheet.setActiveCell(CellAddress address). However, I'd like to set it to a Range containing more than one cell on the sheet,…
padrino
  • 299
  • 3
  • 14
0
votes
0 answers

Apache POI XSSFCell not taking Cell.CellType as argument

Ahoi there, I am trying to set the CellType of an XSSFCell. Basically I want to have just on set of methods to export a HSSF and a XSSFWorkbook and according to the API it SHOULD work. Workbook workbook = new XSSFWorkbook(); //Alternatively…
Richard
  • 1
  • 2
0
votes
1 answer

using apache poi to parse a particular column and print required string in an adjacent column

I am trying to print a string in a specific column of a xlsx file using apache poi in java. I have parsed the column x using regex and printing the required string in column y. However the getRowNum() of the code flags…
0
votes
1 answer

how to solve the error java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject

File file = new File("D:\\testExcelInput.xlsx"); FileInputStream fIP = new FileInputStream(file); //get the existing sheet from the workbook XSSFWorkbook wb = new XSSFWorkbook(fIP); XSSFSheet sheet = wb.getSheetAt(0); //get the…
Mohit Joshi
  • 53
  • 3
  • 9
0
votes
3 answers

How to set date field in excel using java apache poi library?

I have to set the date field in excel file (.xlsx or .xls) using java apache poi library. I have tried setting the cellStyle and dataFormat of the cell but it does not set it as date field and instead stores it as string or numeric field. Here is my…
agrawalsp
  • 31
  • 10
0
votes
0 answers

memory issue in Java Eclipse while generating Data validation report using XSSF

I'm doing automation tool for ETL testing. It will extract data from an Oracle database and paste in Microsoft Excel and compare source-target based on the key columns. While generating report, if the records exceeds 8000 it hits an…
0
votes
0 answers

Apache POI Writing data to existing sheet

I am trying to write data in an existing excel (xlsx) file using Apache POI. The code does not give any error and the sysout shows the updated data in the cell. However the same is not reflected in the excel workbook when I open it. This is my code…
Saikat
  • 14,222
  • 20
  • 104
  • 125
0
votes
1 answer

Unreported Exception. Must be caught or declared to be thrown

so I'm in the process of trying to learn Apache's POI API and I'm having a little difficulty understanding something. I'm trying to open an existing Excel File using the JFileChooser class, so that the user selects the Excel file and then I'll…
humbleCoder
  • 463
  • 1
  • 5
  • 18
0
votes
0 answers

Not able to see the content of POI Excel Header

I am creating POI Excel sheet with a header, although header is getting created but every time after downloading the excel I have to enable header to see the header content. Please help me so that when I download and open the excel sheet, I do not…
Sunil
  • 102
  • 1
  • 5
  • 19