0

I've created an excel sheet using apache poi library and tried so much to change column width with respect to the content length by using autoSizeColumn() method, but no luck. I've used poi 2.5.1 and jdk 1.6. This is my code segment.

for (int columnIndex = 0; columnIndex < 8; columnIndex++) { sheet.autoSizeColumn(columnIndex); } 

I've used this code segment after inserting data to the excel sheet. The error message said that "cannot find symbol"

Any help would be appreciated.

Thanks in advance.

2
  • which line is throwing the error Commented Aug 27, 2013 at 3:35
  • 1
    Second line. It says autoSizeColumn() method cannot be found. Commented Aug 27, 2013 at 5:37

1 Answer 1

1

Your version of Apache POI (2.5.1) is quite old (released 2004-02-29) and for that version, the Sheet interface doesn't have the autoSizeColumn method. For most open source projects, the documentation on the web is usually for the current stable release, which for POI is currently 3.9 (released 2012-12-03).

You can get source & documentation for your version of POI, but consider upgrading your version of POI - the latest version works with Java 1.6.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.