Project Center Views – Filtering Client v Server

I have been waiting for SP1 before blogging this as it might have frustrated a few people as pre SP1 there were some broken pieces here.  The filter that you use when creating a view for everyone through Server Settings, Manage Views behaves slightly differently from that found on the client side when a user creates their own filters.  So why is this?  To explain I will use the example of filtering for particular project types.  I will base this on the out-of-the-box Project Center, Summary view, with the field Project Type added.

Here is a view of my starting point view – where “Maintenance Project” is the term for Proposals and Activity Plans.

image

When adding a filter on the client in Project Center the filter works as most people would expect – it is doing a text comparison.  If I want to just see Maintenance Projects I can set a custom filter where the Field Name Project Type contains the word Maintenance.

image

And then we see:-

image

But if we want a view that users can choose that automatically has this filter then we probably want to define it on the server. Setting exactly the same filter in the view definition for Summary in Manage Views gives this:-

image

Why is nothing showing up?  The reason is that server side filters are not working quite the same as on the client – and are doing their comparisons against an enumeration of the Project Type defined as a number.  Maintenance Projects have a Project Type of 4 – so with a filter set like this – where Project Type equals 4

image

we get what we want on the client with no client side filters set.

image

Enumerations for various of these kind of things can be found in the SDK.  This different behavior makes more sense when you look at different language versions.  If you have created a PWA site in French for instance you can set a server side filter for Maintenance Project without needing to know the French term.  Remember on the server you can filter on a field that is not displayed – so it isn’t as silly as it sounds…

image

I know in this case it wouldn’t make much difference – maintenance is maintenance – but other translations may be more challenging (at least to me).  This is a site provisioned in Korean, and viewed with IE set to French – just so you can see we are still looking at the same field.

image

I hope this helps you understand why there are differences in the filters – and how to use them.

Technorati Tags: Project Server 2007