Questions tagged [hssf]

HSSF provides Java APIs to read / write Microsoft Excel 2003 and before (.xls) files. This tag should be used for questions about accessing Excel 2003 files from Java applications. HSSF is managed under the Apache POI Project.

HSSF provides Java APIs to read / write Microsoft Excel 2003 and before (.xls) files. This tag should be used for questions about accessing Excel 2003 files from Java applications. HSSF is managed under the Apache POI Project.

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

117 questions
1
vote
1 answer

C# NPOI library missing?

I'm having trouble with understanding what to replace Workbook with as it keeps getting the error "doesn't exist in the current context. I'm not sure if it has to do with me missing a library or carelessness. using NPOI.HSSF.UserModel; using…
1
vote
0 answers

HSSF setborderbottom doesn't work last excel cell

I am using POI to generate an Excel File. I need to add borders to all cells , i made a for loop i was able to add borders to all cells but not the last cells of the last row . HSSFCellStyle cellStyleAllF = null; cellStyleAllF =…
1
vote
2 answers

Why "cellIterator.hasNext()" is getting "TRUE" even though cell has empty value

consider below screenshot of my excelSheet Now consider below code, which will iterate every row then iterate every cell and then print cell value. public void excelData2(int sheetNo) { Iterator rowIterator =…
Jagadeesh
  • 358
  • 5
  • 17
1
vote
1 answer

Get number of rows with Apache POI

I try to count number of rows in a xls file with Apache POI. File contains 300 rows, but I get just 24 as output of both of these commands. int noOfColumns = sh.getRow(0).getPhysicalNumberOfCells(); int noOfColumns =…
plaidshirt
  • 5,189
  • 19
  • 91
  • 181
1
vote
0 answers

how to add shapes in word document using apache poi library

I need to add below shapes available in MS word using Apache poi library. I am not able to find any specific class/method available for word to add such shapes. However, I can find some method to add shapes in excel from apache. XSSFDrawing…
Arvind
  • 46
  • 9
1
vote
1 answer

apache.poi HSSFCell getNumericCellValue incorrect read

I read numeric values from excel using apache.poi. hssfCell.getNumericCellValue() But here is example of excel file where the result is wrong. Example of excel file The correct result for cell N14 is 11,115 (or 11,12 with excel formatting). But…
1
vote
0 answers

how to overwrite rows and columns in excel using HSSF

I'm trying to overwrite data in excel but it only writes last row and column while what I want is to overwrite everything. Here is my code. for(int i=0; i < 139; i++){ for(int j=0; j < 9; j++){ HSSFRow read_row =…
tony lee
  • 25
  • 4
1
vote
1 answer

Java Check if the Text in a Cell is Bolded Using Apache POI HSSF

Using Java and Hssf to get Excel data, how to check if a cell is bolded? I am iterating through all sheets, all rows, and all cells of an Excel workbook. I want to perform an action if the cell is bolded. //Iterate through excel sheets for (int…
pseudorandom
  • 267
  • 5
  • 20
1
vote
2 answers

HSSF cell style applied only after clicking it in Excel

As article states - created style applies only after i open created *.xls file and double click formatted cell. public HSSFWorkbook makeWorkbookExc(List allValues, List captions, Integer[] order, List
mAtsea
  • 47
  • 5
1
vote
0 answers

File size changing on re-save

I am currently generating an .xls file using the HSSFWorkbook library in Java, which a downstream system is parsing to read some data. Recently, we ran into an issue where the file was encountering an exception of missing expected values, despite…
dfader2
  • 131
  • 11
1
vote
1 answer

How to make Excel's "Text to columns" in Java?

I am trying to write something in Java that basically does the same thing as "Text-to-Columns" in Excel. I have a long string of data (parsed out from some HTML) and I formatted it to divide the data I need by a semicolon. For example Str = brand…
1
vote
1 answer

org.apache.poi writing xls formula of cells sum

I have to write xls formula that will sum few cells from one column. The output in xls of that formula look that: SUM(F5;F9;F13;F16) I've created that formula in org.apache.poi library. Cell cell =…
masterdany88
  • 5,041
  • 11
  • 58
  • 132
1
vote
1 answer

writing excel through JAVA using HSSF workBook

I am using HSSF work book to write data into excel using java, Now i have a column name with n-no of words, if i insert it normally its coming in a same line, i want to break the sentences into two different line and insert into same cell. below is…
tom
  • 5,114
  • 6
  • 24
  • 36
1
vote
0 answers

Memory leak when using Apache POI HSSF?

Have looked around extensively but can't find a definitive answer to this: are objects created using Apachie POI HSSF reclaimed by the normal Java gc, or do I need to do something else? I have a Java program that reads files of test data and writes…
user1359010
  • 243
  • 3
  • 11
1
vote
1 answer

HSSF - How to keep Date data type when exporting to excel using HSSF

I am using POI-HSSF to export some data to excel. Requirement is I need to keep data type of each column. I can keep data type for string and numeric values but not the date. I studied in POI documentation that it supports only 3 basic data types…