Free Support Forum -

How to apply filter Criteria to filter tasks


We can access all the task filters from Project.TaskFilters collection where each Filter item contains FilterCriteria property. How can I apply a filter item to filter tasks?
I have seen that there is a method present which could serve my purpose is Aspose.Tasks.Util.TaskUtils.Filter(Task root, ICondition cond), but it takes ICondition.
I found no way to filter tasks using the Filter/Criteria object.
Is there any way to do this?



I have observed your inquiry and request you to please elaborate the requirements in the form of sample application and source file. We will be able to investigate further on our end on provision of requested information.


We are working on implementing an application that exports a file from mpp file by following ISO standard (ILAP).
There we will give the user an option to filter out the tasks while exporting from the available task filters.
I have added a sample application to get a better understanding of what I am looking for. Let me know if you need further clarification.

        var project = new Project(@"../../TestData/TestMsProject.mpp");

        // All tasks
        var allTasks = project.RootTask.SelectAllChildTasks();

        var taskFilters = project.TaskFilters;

        // User will get a dropdown list to select a filter item
        var selectedFilter = taskFilters.SingleOrDefault(x => x.Name == "Active Tasks");

        if (selectedFilter != null)
            // TODO: Need to apply the selected filter, need a method something like TaskUtils.Filter()
            //var filteredTasks = Aspose.Tasks.Util.TaskUtils.Filter(project.RootTask, selectedFilter);
        } (240.2 KB)



Thank you for your feedback.

We have logged this issue with ID “TASKSNET-3007” for further investigation, you will automatically be informed here once we have more information to share.