Questions tagged [poi-hssf]

HSSF is the Apache POI project's Java API for manipulating Excel format files (.xls and .xlsx)

The POI-HSSF tag is used for Apache POI Project's Java API for manipulating Excel format files (.xls and .xlsx).

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.

This tag should be used for questions around using and extending Apache POI HSSF.

More information on HSSF, the bug tracker and download links are available from http://poi.apache.org/spreadsheet/index.html

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

165 questions
9
votes
1 answer

java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream

When I'm reading Excel file(.xls format), I keep getting an Exception : java.lang.IllegalArgumentException: Your Input Stream was neither an OLE 2 stream, nor an OOXML stream. I Go-ogled and found that if the input stream is not supporting reset or…
mee
  • 821
  • 5
  • 12
  • 28
8
votes
1 answer

Is there any alternate way to avoid deprecation in Apache POI, for HSSF built-in colors?

In my code i want to change the cell colors of a particular column of a HSSFWorkbook, if the text is "PASS". But when i was writing the code, lots of methods and constants like BRIGHT_GREEN.index, setFillPattern, SOLID_FOREGROUND are deprecated. I…
BongCule
  • 115
  • 1
  • 2
  • 9
7
votes
4 answers

how to create dynamic rows of records for creating xls file using list

Here after fetching records from database I have added data in some list and I have set some session variables for them so that I can access in another method by using get(key) method of session which I am successful to do so .Now what I want is I…
user5750833
7
votes
1 answer

Getting error "Your InputStream was neither an OLE2 stream, nor an OOXML stream" when created file through apache POI

I am trying to check if my excel file already exists. If it doesn't exists, I want to create a new one and if it exists I will delete it and create a new one. I wrote following program but I am getting error at line - workbook=…
For Testing
  • 281
  • 2
  • 5
  • 19
6
votes
2 answers

apache poi: saving jtable to a file

I've recently started working with java and I'm facing some issues with the apache poi library when I need to create an excel file starting from a jTable. I've read many threads and come up with some code which just won't work (even if this is…
Marchius
  • 115
  • 1
  • 3
  • 10
5
votes
3 answers

How to search an Excel sheet for a specific date using Apache POI?

I've been using the example code given to search the sheet's contents: Sheet sheet1 = wb.getSheetAt(0); for (Row row : sheet1) { for (Cell cell : row) { CellReference cellRef = new CellReference(row.getRowNum(), cell.getCellNum()); …
Jsk
  • 53
  • 2
  • 4
5
votes
3 answers

Increase the maximum length of HSSFCell in java

Actually I tried to store some data in HSSFCell using java but i got an error like java.lang.IllegalArgumentException: The maximum length of cell contents (text) i s 32,767 characters at…
vineeth
  • 641
  • 4
  • 11
  • 25
5
votes
6 answers

How can we read protected password excel file (.xls) with POI API

I've just learned POI and find the HSSF is very simple to read and create excel file (.xls). However, I found some problem when want to read excel protected with password. It took me an hour to find this solution on internet. Please could you help…
embarus
  • 815
  • 3
  • 14
  • 28
4
votes
3 answers

How to create cell with multiple styles in excel using HSSFSheet Apache POI?

I am creating a script for export document as excel. How to have cell value like "Name: Mark DOB: 11-11-2014" by merging few cells?
Krunal Shah
  • 2,083
  • 12
  • 27
3
votes
1 answer

How to determine whether a spread-sheet cell contains a date, or a real number?

When a cell in a spreadsheet contains a simple date (mm/dd/yyyy) the poi API flags the cell-type as 'numeric'. This is probably because spreadsheets ( IMO ) historically recognize only strings and real numbers. It is possible to hard-code the…
Everyone
  • 2,366
  • 2
  • 26
  • 39
3
votes
5 answers

Exporting Jtable into the Excelsheet using HSSFWorkbook

Hello I am trying to Export Jtable Data into the Excel Sheet using HSSFWorkbook. and i am getting all the content what Table have but i am not getting Table Headers please can anyone help for the same. Here the Command used for Taking content of the…
Kishan Bheemajiyani
  • 3,429
  • 5
  • 34
  • 68
2
votes
2 answers

Apache POI-HSSF: Getting Decimal Instead of Text String

I am using Apache POI-HSSF for working with Excel files. I have a cell in my spreadsheet that looks like "115". I verified that it is formatted as "Text" (Format Cells -> Text). However, when I read it in as row.getCell(0).toString() I get this…
user783312
  • 65
  • 1
  • 5
  • 9
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
2 answers

Copy and paste rows with HSSF (Apache POI)

Possible Duplicate: How to insert a row between two rows in an existing excel with HSSF (Apache POI) How can I copy the values and all the formatting of a row using HSSF. Using the MS Excel or other Spread Sheet application it is easy as copy and…
ace
  • 6,775
  • 7
  • 38
  • 47
2
votes
4 answers

javac: package org.apache.poi.hssf.usermodel does not exist

I have a program attempting to use classes from the jakarta-poi-3.0.2.jar in my /usr/share/java directory: import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import…
Max
  • 1,295
  • 6
  • 16
  • 31
1
2
3
10 11