Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JSpreadsheet
>
Tutorial
> Display Cell Values - Solution I
The following example shows you how to display values from all cells.
import java.util.List; import com.independentsoft.office.spreadsheet.Cell; import com.independentsoft.office.spreadsheet.Sheet; import com.independentsoft.office.spreadsheet.Workbook; import com.independentsoft.office.spreadsheet.Worksheet; public class Example { public static void main(String[] args) { try { Workbook book = new Workbook("c:\\test\\input.xlsx"); for (Sheet sheet : book.getSheets()) { if (sheet instanceof Worksheet) { Worksheet worksheet = (Worksheet)sheet; List
cells = worksheet.getCells(); for (int i = 0; i < cells.size(); i++) { System.out.println(cells.get(i).getReference() + " = " + cells.get(i).getValue()); } } } } catch (Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*