Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Java: Общие вопросы > Задача - как использовать auto fit для ячейки


Автор: bulat01 2.2.2012, 10:45
Привет всем.
Пож-та посоветйте как использовать JExcel API
стоит следующая задача - как использовать auto fit для ячейки.

в одном форуме нашел следующее:
--------------------------------------------------------------------------------

CellView's autosize method doesn't work for me all the time. My way of doing this is by programatically set the size(width) of the column based on the highest length of data in the column. Then perform some mathematical operations.

Код

CellView cv = excelSheet.getColumnView(0);
cv.setSize((highest + ((highest/2) + (highest/4))) * 256);


where highest is an int that holds the longest length of data in the column.
--------------------------------------------------------------------------------

а как определить highest значение пока не понимаю как - пож-та посоветуйте?




Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)