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

Using findSimilarColor to set a Background on Excel file

I'm having a little problem using the findSimilarColor on my java code. I already read some articles from the stackoverflow that helps me get to the following code. HSSFCellStyle style = wb.createCellStyle(); HSSFPalette palette =…
Gabriel Braga
  • 41
  • 1
  • 10
0
votes
3 answers

HSSFWorkbook.write(FileOutputStream fileOut) not writing anything to the response stream

Here is my code snippet try{ response.setHeader("Content-Disposition", "attachment;filename=someName.xls"); HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("new sheet"); HSSFRow row =…
Abhishek Singh
  • 10,243
  • 22
  • 74
  • 108
0
votes
2 answers

java convert HSSFCell to number

Could anyone help? By using that code, I was able to get a value from an Excel field as well. There is a value for a specific column = 5. public Integer Check4(int b) throws IOException { InputStream myxls = new FileInputStream("book.xls"); …
Leo
  • 1,787
  • 5
  • 21
  • 43
0
votes
1 answer

open excel sheet using hssfworkbook

I am opening an excel sheet having 3 tabs, and I am writing i to those 2 tabs depends upon which of the given three links is clicked in the form. To explain further I have 3 links in form Add, Cancel, Modify and clicking on a certain link would…
0
votes
0 answers

How to use "trim" while retrieving data from xls sheet and csv file?

i have done following to retrieve code from xls sheet and csv file. i tried using ".trim()" but I am not getting the required output. Please tell where I am going wrong in order to remove any trailing blank spaces from xls cell and csv file. for…
akash
  • 105
  • 2
  • 13
0
votes
1 answer

Java - Write excel only last data

int temp = 7; File folder = new File("//Users//" + usr + "//Desktop//TNA//input1//"); File[] listOfFiles = folder.listFiles(); if (listOfFiles != null) { for (int i = 0; i < listOfFiles.length; i++) { if…
chinna_82
  • 6,353
  • 17
  • 79
  • 134
0
votes
3 answers

Java - Unable write in excel cell

FileInputStream file = new FileInputStream(new File("//Users//"+ usr +"//Desktop//TNA//output//output.xls")); HSSFWorkbook workbook = new HSSFWorkbook(file); HSSFSheet sheet = workbook.getSheet("Sheet1"); Cell name_c = null; Cell department_c =…
chinna_82
  • 6,353
  • 17
  • 79
  • 134
0
votes
1 answer

Is it the setFillBackgroundColor command

How do I change the font color to white on just one of the else if lines? The else if on the "INSUFFICIENT RECORDS" line that is commented out is the one that I want to change. For some reason I thought it would be the setFillBackgroundColor…
Zornjac
  • 261
  • 2
  • 6
  • 20
0
votes
1 answer

Unable to set value for HSSFCell object dynamically

I am trying to export data from my jsp to excel using Apache POI. The Number of columns that I need will depend on two parameters and hence, I fetch it through a query. For EX : If No. of dynamic columns required = 3, then output should be…
sweetu514
  • 65
  • 1
  • 18
0
votes
0 answers

Fill color in hssf cell

I have been adding background as shown below. All other changes are seen in the excel but cell does not get filled with the color. please help public static CellStyle getWeeklyHeaderStyle(HSSFWorkbook wb) { CellStyle cellStyle =…
0
votes
0 answers

Excel Sheet reading (Particular cell)?

How to read certain text font (for specific subscript, superscript uppercase lowercase, italic bold etc.) in a particular cell's. (Not for complete cell, or not to set that format for complete cell)? like for Example: I have a cell in a spreadsheet…
pfflet
  • 1
  • 1
0
votes
1 answer

What is wrong with this cycle. HSSF

In this code i'm searching from List of Lists element, which contains in List. Why when i found needed elements, it's starting work bad. If i find another element, which contains in List, this cell should be fill in BLUE color, but that do not…
Eldar
  • 153
  • 5
  • 13
0
votes
0 answers

Fill the cell in xls file, using apache-poi

Why it doesn't work? I use setFillForegroundColor and it clears the cell, rather than to fill it with a color(lime) . //Get the workbook instance for XLS file HSSFWorkbook workbook = new HSSFWorkbook(file); CreationHelper createHelper =…
Eldar
  • 153
  • 5
  • 13
0
votes
2 answers

Does CELL_TYPE_BLANK works for hssf or xls files?

I wanna ask that does CELL_TYPE_BLANK works for hssf or xls file system? I knw it works for xlsx or XSSF but i'm having problem with xls?
v0ld3m0rt
  • 866
  • 3
  • 12
  • 47
0
votes
0 answers

why does my program adds blank spaces automatically?

I created a csv file(| delimited) which contains some data but few rows are created automatically at the end of every row and column. There are only 4 rows in the excel file but when it converts to csv it shows…
v0ld3m0rt
  • 866
  • 3
  • 12
  • 47