@ Override public XlsWorksheet createSheet ( FileColumn [ ] columns , List < String [ ] > lines , String sheetName ) throws IOException { // Create the worksheet and add the cells WritableSheet sheet = writableWorkbook . createSheet ( sheetName , 9999 ) ; // Append sheet try { appendRows ( sheet , columns , lines , sheetName ) ; } catch ( WriteException e ) { throw new IOException ( e ) ; } // Set the column to autosize int numColumns = sheet . getColumns ( ) ; for ( int i = 0 ; i < numColumns ; i ++ ) { CellView column = sheet . getColumnView ( i ) ; column . setAutosize ( true ) ; if ( columns != null && i < columns . length ) { CellFormat format = columns [ i ] . getCellFormat ( ) ; if ( format != null ) column . setFormat ( format ) ; } sheet . setColumnView ( i , column ) ; } return new XlsWorksheet ( sheet ) ; }
Creates a sheet in the workbook with the given name and lines of data .