0

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 text which has nearly 4000 characters");
cell.setCellValue(sb.toString());
Paco Abato
  • 3,920
  • 4
  • 31
  • 54
Nomad
  • 751
  • 4
  • 13
  • 34
  • The [POI class which contains all the spreadsheet format limits](https://poi.apache.org/apidocs/org/apache/poi/ss/SpreadsheetVersion.html#EXCEL97) suggests `.xls` should be fine with cells of up to `32767` characters long. Is it something as simple as the wrapping / column width? – Gagravarr Feb 05 '15 at 22:46
  • Kindly provide a substantial chunk of code for better understanding of your problem. – Ankur Piyush Feb 09 '15 at 15:58
  • as @Gagravarr said, it allows 32767 characters. There was small mistake from my side with cellstyle alignment. Now it is working. Thanks. – Nomad Feb 09 '15 at 19:45

1 Answers1

0

As @gagravarr said cell can store up to 32767 characters long. https://poi.apache.org/apidocs/org/apache/poi/ss/SpreadsheetVersion.html#EXCEL97

Nomad
  • 751
  • 4
  • 13
  • 34