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

how to set cell style without HSSFWorkbook instance?

I wanted to set font of the title row in a spreadsheet bold. I was able to do that in my main function with the following code: HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet dataSheet = workbook.createSheet("Data"); HSSFCellStyle fontStyle =…
Nasreddin
  • 1,509
  • 9
  • 31
  • 36
2
votes
1 answer

HSSFCell converts Integer to Double

I want to read an Excel Sheet and I am using HSSF. The content of an example row is: Cell0: Cell1: A23456 123 Now I want to read the Cell1 as String "123". HSSF recognizes that 123 is a numeric value (getCellType returns CELL_TYPE_NUMERIC ==…
mrbela
  • 4,477
  • 9
  • 44
  • 79
2
votes
1 answer

Reading excel using POI HSSFCell with leading zeros

I am trying to read an excel file using Java POI HSSF. Everything was working fine, except that when the value is 001001 the HSSFCell will return 1001.0 Is there any way I can use HSSFCell to get the value 001001 ? I am not supposed to do any…
Amblll
  • 88
  • 1
  • 11
2
votes
1 answer

How to append to existing excel file using Java HSSF

I am still relatively new to Java and have cobbled together enough code that allows me to write my data out to a new excel file. However, I want it to write (append to the end) to the existing file. prepareDataToWriteToExcel() gets some data to…
Jared
  • 67
  • 1
  • 1
  • 8
2
votes
1 answer

how to modify metadata of a doc document

I'm looking to modify certain tags (like comments, keywords, etc) of a .DOC file. I've been able to do this for DOCX using docx4j but I haven't been able to find anything that lets me change the tags for a .DOC format. Is there a way to…
Anthony
  • 33,838
  • 42
  • 169
  • 278
2
votes
2 answers

increasing the width of the column and not to have exponential value

I have a query is that, I have generated an excel sheet containing many columns with Data. Now there is a column named abc_ID and the value coming from back-end is of long type as shown below //shown below how the value is passed for that…
user2544941
2
votes
1 answer

Apply color to tabs in excel using apache poi

Is there any way by which tabs can be given specific colors using apache poi through java?. I am using HSSF workbook.
nivedita rashmi
  • 183
  • 2
  • 2
  • 5
2
votes
1 answer

Getting error using POI HSSF

I'm getting an error when trying to open an Excel sheet with MS office 2003. This Excel sheet is created using HSSFWorkbook, implementing the usermodel scope org.apache.poi.hssf.usermodel In Microsoft Excel 2003: "Too many different cell formats".…
2
votes
2 answers

Executing Excel Macro From ColdFusion Server

I have a ColdFusion Web application which lets the user upload an Excel Workbook on the server. I would like to execute a macro within that Excel file, once the file has been uploaded. Anyone has an idea on how I could manage to do that?? Note: I…
Francis P
  • 13,377
  • 3
  • 27
  • 51
1
vote
1 answer

Why is a cloned HSSFCellStyle not equal to the style it was cloned from?

I am using one HSSF Workbook as a template for another. Because of how that works, as you probably know if you're reading this, I cannot simply take a cell from workbook 1 and set its style to the CellStyle from workbook 2. The way this is…
Anonymous
  • 3,334
  • 3
  • 35
  • 50
1
vote
1 answer

Extracting data in spreadsheet columns in Apache POI API

Just want to make sure one thing. Does the Apache POI API have any built-in collection/object, like row and cell, for a column in a spreadsheet? Or do I have to build one myself and add all the cells in the column there to do the sorting etc? Is…
1
vote
3 answers

Apache POI extracting value as it looks in Excel

I have Excel file and some contents, coming from external source(database, file, whatever). I've encountered problems with numeric cells in Excel -getNumericValue returns double value for any cell, no matter how value is formatted in it. External…
Anton
  • 3,006
  • 3
  • 26
  • 37
1
vote
0 answers

Latest poi 5.2.1 version is having issue with HSSFWorkbook(fis)

I have updated poi version from 4.1.1 to 5.2.1. After upgrade I am facing issues with xls and xlsx format files. I currently have poi-5.2.1.jar, poi-ooxml-5.2.1.jar, xmlbeans 3.1.0, commons-io-2.8.0 version and commons-compress-1.21.jar. may I know…
1
vote
1 answer

Binary file encryption with Apache POI

I'm trying to apply encryption to a binary xls file with Apache POI. While I can successfully encrypt xml based files, if I encrypt a binary one I can't open it and I get the wrong password error. This is my code: @Test public void testEncryption()…
firegloves
  • 5,581
  • 2
  • 29
  • 50
1
vote
1 answer

Apache POI : Formula gets removed while reading the cell value using formula FormulaEvaluator

I am using poi version 3.17. In my java code I want to read a cell value which has formula and I am using evaluateInCell function of FormulaEvaluator to resolve the cell value. I have a template excel in my resource in which cells has formulas, if…
jrpsbadmn
  • 45
  • 1
  • 1
  • 6
1 2
3
10 11