-
Notifications
You must be signed in to change notification settings - Fork 5
Export Data from Worksheets
shoaibkhan-aspose edited this page Jun 20, 2014
·
2 revisions
//Creating a file stream containing the Excel file to be opened
FileInputStream fstream = new FileInputStream("data/workbook.xls");
//Instantiating a Workbook object
Workbook workbook = new Workbook(fstream);
//Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.getWorksheets().get(0);
//Exporting the contents of 7 rows and 2 columns starting from 1st cell to Array.
Object dataTable [][] = worksheet.getCells().exportArray(4,0,7,8);
for (int i = 0 ; i < dataTable.length ; i++)
{
System.out.println("["+ i +"]: "+ Arrays.toString(dataTable[i]));
}
//Closing the file stream to free all resources
fstream.close();
Download Source Code
For further releases and updates, please follow these new repositories:
- Aspose.Words Java for Apache POI
- Aspose.Cells Java for Apache POI
- Aspose.Slides Java for Apache POI
- Aspose.Email Java for Apache POI
- For documentation, please visit Aspose Docs.
- Raise your queries and suggest more examples via Aspose Forums or via new social coding sites.