Auto filter Custom issue

Hi

I am using aspose-cells-7.4.2. Till now i applied auto filter like below.
worksheet.getAutoFilter().filter(2, “Rejected”); I am able to get filtered rows based on “Rejected”. Now my requirement is string may be REJECTED or rejected or reject or rejects, then how to apply auto filter based on string “reje” then it is supposed to show all the filtered rows whicha re containing REJECTED or rejected or reject or rejects, It is just like auto filter based on contains condition in Microsoft Excel 2010. Could you please give sample code for this. Thanks for your help.

Hi Rajendra,


Thank you for contacting Aspose support.

Unfortunately, the Aspose.Cells APIs do not provide means to set AutoFilter based on a wildcard selection so that rest of the characters may be substituted with any of a defined subset of all possible characters. Although you can still add as many filters as you may wish to accomplish your goal. Please see the code snippet demonstrated below,

Java

//Add your desired filters
sheet.getAutoFilter().addFilter(0, “Rejected”);
sheet.getAutoFilter().addFilter(0, “Reject”);
sheet.getAutoFilter().addFilter(0, “Rejects”);

sheet.getAutoFilter().refresh();

Hope this helps a bit.