Iterar filas y columnas
Contents
[
Hide
]
Cómo iterar filas y columnas usando Aspose.Cells for Java
Las filas y columnas se pueden iterar utilizando la colección de filas y columnas.
Java
//Acceder al rango máximo de visualización
Rango rango = hoja de trabajo.getCells().getMaxDisplayRange();
int tcols = rango.getColumnCount();
int trows = range.getRowCount();
System.out.println("Total de filas:" + trows);
System.out.println("Colos totales:" + tcols);
Filas de RowCollection = cell.getRows();
para (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("");
}
Apache POI SS - HSSF XSSF - Iterar filas y columnas
Las filas y Cells se pueden iterar en la Hoja. El código de muestra se menciona a continuación:
Java
Workbook wb = WorkbookFactory.create(inStream);
Sheet sheet = wb.getSheetAt(0);
for (Row row : sheet)
{
for (Cell cell : row)
{
System.out.println("Iteration.");
}
}