JXL(JExcel API) is a very useful library for handling Microsoft Excel files on Java envrionment. I like JXL because of its simple and intuitive usage. And also it works very well.
During works with JXL, developers want to specify column width. ColumnView is very helpful for this.
JExcel API's FAQ also describes too.
If you want that 1st column has 15 characters width, you can use like this:
sheet.setColumnView(0, 15);
You can also make auto sizable to the 2nd column:
CellView autoSizeCellView = new CellView();
autoSizeCellView.setAutosize(true);
sheet.setColumnView(1, autoSizeCellView);
autoSizeCellView.setAutosize(true);
sheet.setColumnView(1, autoSizeCellView);
"Auto Size" works well, but the result is not always so good. In some cases, you can face to the undesirable output.
댓글을 달아 주세요