Free Support Forum - aspose.com

Aspose.Cells for Java - Managing Excel Worksheet Question

Hello, this is Nobuaki at XLsoft Corporation.

We have the customer with the following question.

Product: Aspose.Cells for Java

Question:
The customer use Aspose.Cells for Java to create a Java application which operates Excel files.

When the Java application opens an Excel Book, can an Excel Worksheet be specified?
If so, please let us know how to specify the worksheet.

When the Java application uses AutoFilter feature, can an Excel Worksheet be saved with the filtered data?
If so, please let us know how to implement this.

Thank you for your help.
Best Regards,
Nobuaki

Hi Nobuaki,

Thanks for considering Aspose.

When the Java application opens an Excel Book, can an Excel Worksheet be specified?
If so, please let us know how to specify the worksheet.

Check the sample code:

//Instantiating a Workbook object
Workbook workbook = new Workbook();
.
.
Worksheets worksheets = workbook.getWorksheets();
Get the first worksheet.
Worksheet worksheet = worksheets.getSheet(0);
.
.
.

Also, you may check for further reference: http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/managing-worksheets.html

When the Java application uses AutoFilter feature, can an Excel Worksheet be saved with the filtered data? If so, please let us know how to implement this.

Check the sample code:

Workbook workbook = new Workbook();
workbook.open("e:\\files\\mybook.xls");
Worksheets worksheets = workbook.getWorksheets();
Worksheet sheet = worksheets.getSheet(0);
AutoFilter autoFilter = sheet.getAutoFilter();
autoFilter.setRange(new CellArea(0,0,7,2));
autoFilter.filter(0,"myvalue");
workbook.save("e:\\files\\outBook.xls",FileFormatType.EXCEL2003);

For reference: http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/data-filtering-and-validation.html

Thank you.