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
0
votes
1 answer

Set cellStyle to cell or row in HSSFWorkbook

I declared internal variables in this way: FileOutputStream fos; HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet("analyze_result"); Row row = sheet.createRow(rowIndex); Cell cell =…
Udi
  • 598
  • 8
  • 19
0
votes
1 answer

HSSFHyperlink and URL fragment encoding

I am using the apache poi package to generate excel workbooks. In the workbook I include cells with hyperlinks, using URLs containing fragments (#frag). In the resulting cells, the # character in the url has been encoded which makes it a different…
jbelis
  • 575
  • 2
  • 6
  • 16
0
votes
0 answers

Getting error "Unable to read entire header" when created file through apache POI

I am using Java and POI 3.7 and I want to perform following in xlWrite() function- 1. Check the file. If it doesn't exist create a new one. If file exists, delete it and create a new one. (DO I have to delete it or if it exists already my new…
For Testing
  • 281
  • 2
  • 5
  • 19
0
votes
1 answer

CellStyle dataformat for XLSX

I have some code like : CellStyle cs2 = wb.createCellStyle(); CellStyle cs4 = wb.createCellStyle(); cs4.setDataFormat(HSSFDataFormat.getBuiltinFormat("CELL_TYPE_NUMERIC")); cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text")); this is for…
AbtPst
  • 7,778
  • 17
  • 91
  • 172
0
votes
3 answers

How to program to save a bunch of ".xls" files in Excel

I need to process a lot of .xls files which come out of this Microscopy image analysis software called Aperio (after analysis with Aperio, it allows you to export the data as "read-only" xls format. The save-as only works in Excel on a Mac, on…
Nasreddin
  • 1,509
  • 9
  • 31
  • 36
0
votes
1 answer

Null pointer exception while returning cell value from excel

I have the following code private void execute_TestCase() throws Exception { int iTotalTestCases = ExcelUtils.getRowCount(Constants.Sheet_TestCases); System.out.println("Total TC count" + iTotalTestCases); …
user1700354
  • 107
  • 2
  • 3
  • 15
0
votes
1 answer

set HSSFCell with long text

I am using POI HSSFWorkbook to generate excel sheet. I need to add a large string to HSSFCell, I have tried using all possibilities as below to set the value but I couldn't see anything in the excel file which has been generated. sb.append("A long…
Nomad
  • 751
  • 4
  • 13
  • 34
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
1 answer

Spring MVC : HSSFWorkbook.write(ServletOutputStream) prints garbage value on browser

I have to give a functionality to user for excel download. Here is my controller code snippet @RequestMapping(value = "downloadFIReport.do", method = RequestMethod.GET) public void downloadFIReport(@RequestParam("recieptID") String…
Abhishek Singh
  • 10,243
  • 22
  • 74
  • 108
0
votes
1 answer

POI HSSF XLS Download issue in Servlet - New XLS file is downloading with previous sheets

I have created Servlet, which downloading POI XLS file, on the first get/post request new file is downloading with sheet0. When i am doing second request new file is downloading with two sheets sheet0 is previous request sheet1 is new request. Like…
R D
  • 1,330
  • 13
  • 30
0
votes
0 answers

getColumnIndex() GIVING error in HSSFCell

Iam working on getting Column Index for excel Sheet using HSSFCell. This is code if(cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC) { int index = cell.getColumnIndex(); …
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

How to read excel file from particular row?

I want to read from a particular row say after nth row of excel sheet in Java. I don't want to check whether the cells have value in it or not. I just want to skip some of the starting rows say n and start reading from n+1 th row. How would I…
akash
  • 105
  • 2
  • 13
0
votes
0 answers

Can't we download Excel file by creating a new Excel without saving it in server

Can't we download Excel file by creating a new Excel. without saving it in any location.Here is the code to create an excel in C:\new.xls. I have a scenario to download the data in Excel. How can i do that by saving that in downloads folder. Please…
Odaiah
  • 305
  • 3
  • 6
0
votes
1 answer

HSSFWorkbook Error

Hi I am having an error when I try to use the HSSF Workbook. See this error Exception in thread "Thread-13" java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook at…
Bimbz
  • 443
  • 2
  • 5
  • 18