//Instantiating a Workbook object Workbook workbook = new Workbook(); //Opening the Excel file through the file stream workbook.open("C:\\book1.xls"); //Accessing the first worksheet in the Excel file Worksheet worksheet = workbook.getWorksheets().getSheet(0); //Creating AutoFilter by giving the cells range AutoFilter autoFilter = worksheet.getAutoFilter(); autoFilter.setRange(new CellArea(0,0,4,1)); //Saving the modified Excel file workbook.save("C:\\output.xls");
Please use AuotFilter.filter() method to set the criteria. See following codes:
//Instantiating a Workbook object Workbook workbook = new Workbook(); //Opening the Excel file through the file stream workbook.open("C:\\book1.xls"); //Accessing the first worksheet in the Excel file Worksheet worksheet = workbook.getWorksheets().getSheet(0); //Creating AutoFilter by giving the cells range AutoFilter autoFilter = worksheet.getAutoFilter(); autoFilter.setRange(new CellArea(0,0,4,1));
//Set filter criteria
autoFilter.filter(0,"criteria"); //Saving the modified Excel file workbook.save("C:\\output.xls");
I had some new problems with a procedure that worked fine in the past.
ChartArea.getArea : Why did this change ?? The class changed form com.aspose.cells.G to com.aspose.cells.cD to com.aspose.cells.cY !! Can you avoid this in the future, it would save us from unexpected errors.
java.lang.ArrayIndexOutOfBoundsException at java.lang.Throwable.(Throwable.java:180) at java.lang.Exception.(Exception.java:29) at java.lang.RuntimeException.(RuntimeException.java:32) at java.lang.IndexOutOfBoundsException.(IndexOutOfBoundsException.java:27) at java.lang.ArrayIndexOutOfBoundsException.(ArrayIndexOutOfBoundsException.java:26) at com.aspose.cells.bj.e(Unknown Source) at com.aspose.cells.bj.a(Unknown Source) at com.aspose.cells.ce.d(Unknown Source) at com.aspose.cells.ce.a(Unknown Source) at com.aspose.cells.v.b(Unknown Source) at com.aspose.cells.v.a(Unknown Source) at com.aspose.cells.Cell.c(Unknown Source) at com.aspose.cells.Worksheet.a(Unknown Source) at com.aspose.cells.Workbook.calculateFormula(Unknown Source) java.lang.ArrayIndexOutOfBoundsException at java.lang.Throwable.(Throwable.java:180) at java.lang.Exception.(Exception.java:29) at java.lang.RuntimeException.(RuntimeException.java:32)
Would you please give us more details about this issue, such as the Exception stack trace, sample code, template file, that would help us to figure it out soon. Thank you.
Aspose.Cells is obfuscated. You only need to use the public APIs:
For your previous error message, it seems a problem of formula calculation engine. Could you please provide some sample code and file to reproduce your problem? We tried but cannot find your mentioned errors.