Excel columns expand using poi

(Last Updated On: [post_updated])

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.

 

 

526 total views, 0 views today

Leave a Reply

Your email address will not be published. Required fields are marked *