Worksheet autofilter

Hello,

I don't know how to set the filtercriteria in aspose.cells for java.

Setting the filter range works fine.

Then I try to set the filtercriteria, but without succes.

setFilter(0, 'does not contain, ""') --> does not work

Can you help me ?

Thanks

Hi,

Thanks for considering Aspose.

May the following code help you for your need.

//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");

For further ref, please check:

Thank you.

Hi,

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");

autoFilter.filter(0,"criteria");

Ok, this is what I find everywhere, but how do I specify this criteria ?

I want to see all rows where column 1 = nonblanks

criteria ? --> does not equal, "" ?

Can you help me on this issue ? (urgent!)

Thanks

Hi,

We will get back to you soon.

Thanks for being patient!

Hi,

Please try this fix.

Please use AutoFilter.matchNonBlanks(int fieldIndex) method.

Works fine !

Thanks a lot !

Kind regards,

Hendrik Goddeau

Help !!!!!!

I'm having problems setting the license !?

Can you check this in this fix, I had this problem in previous versions.

Hi,

What is the error description?

Thank you.

Sorry, I located the problem.

A link to the jar-file was missing.

Thanks

Hello,

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.

I hope this was a standallone problem.

Thanks.

Hi,

Please do not use classes or methods which are not in Aspose.Cells API doc. If you want to get area of the chart area ,please use the following codes:

ChartArea chartArea = chart.getChartArea();
Area area = chartArea.getArea();

I do use this procedure, but I see this is a member of com.aspose.cells.cY

Hello,

After applying this new fix, I get new 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)

.... and so on

What changed ?

Hi,

Could you post your sample code with template file to re-produce the issue. We will check it soon.

Thank you.

Hello,

Is it possible that not all objects are freed properly in this new fix ?!

With this new version I have new problems ! --> Pointer errors !!! --> I think not all resources are released properly !!!

Can you check this as fast as possible ?!

Thanks.

Hi,

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.

This is the workbook I'm creating.

Works fine on first call, but on second call error occurs.