Excel columns expand using poi

Excel header or column expand poi:

As we know that we can able to create the excel sheet using apache poi in java. When you are creating the excel file it may required to expand the column size to fit the content.

In this case you need to use,
sheet.autoSizeColumn(0);

Here 0 is the index of the column.

index 0 means first column 1 means second column etc…

Note:
sheet.autoSizeColumn(0); must be used once the content written to the excel file.

 

 

Leave a Reply