I have a java program that takes header and data as input and creates an excel file.
However, sometimes when the header values โโare long and the number of columns is larger, my excel sheet tends to be overly wide.
Due to the headings, I will have to scroll to the right to see the contents of the end columns.
Is there a way to resolve this so that if the content in the cell is larger, then say x, then the automatic hyphenation will automatically end, and the row height will automatically increase, and the column width will be fixed.
A rough algorithm for what I'm looking for:
if(content.size is more then 50 chars){
- apply auto wrap with centred text
- adjust the row height accordingly
- adjust all the cells in the column accordingly
}
If someone can point me to some example available on the Internet.
Thanks for reading!