Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Rows and Columns can be iterated using rows and columns collection.
Java
//Access the Maximum Display Range
Range range = worksheet.getCells().getMaxDisplayRange();
int tcols = range.getColumnCount();
int trows = range.getRowCount();
System.out.println("Total Rows:" + trows);
System.out.println("Total Cols:" + tcols);
RowCollection rows = cells.getRows();
for (int i = 0 ; i < rows.getCount() ; i++)
{
for (int j = 0 ; j < tcols ; j++)
{
System.out.print(cells.get(i,j).getName() + " - " + cells.get(i,j).getValue() + "\t");
}
System.out.println("");
}Rows and Cells can be iterated on Sheet. Sample code is mentioned below:
Java
Workbook wb = WorkbookFactory.create(inStream);
Sheet sheet = wb.getSheetAt(0);
for (Row row : sheet)
{
for (Cell cell : row)
{
System.out.println("Iteration.");
}
}Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.