I have a class to read an xls in java, and I need to know how to print one column next to another as well as in xls itself. So far I've only been able to print in a single race or online.
NOTE: I'm using the jxl library.
Follow the code:
Workbook workbook = Workbook.getWorkbook( new File( "C:\Users\lm\Desktop\planilha.xls" ));
Sheet sheet = workbook.getSheet( 0 );
int rows = sheet.getRows();
int columns = sheet.getColumns();
for ( int i = 0; i < columns; i++ )
{
for ( int j = 0; j < rows; j++ )
{
Cell cell = sheet.getCell( i , j );
System.out.println( cell.getContents() );
}
}
workbook.close();