

Using value-range filtering and CAML operators in Filter Web Parts










Update: we introduced a much simplified setup approach to value-range filters on 26th Feb 2010. We recommend you try that first, before falling back if necessary to the steps described in this article.
Version 3.0 of FilterZen introduced advanced support for sending multiple filter values to connected List View and Data View Web Parts. One intriguing use case that inspired this capability was a requirement to filter a Date/Time column based on a certain date range, i.e. only setting an interval such as "between 1st January 2008 and 30th April 2008" and filtering a view on column data falling into this range.
With FilterZen, you can achieve this easily by configuring a FilterZen Filter Web Part as follows:
- Connect it to the List View or Data View Web Part of your choice.
- In the Filter Web Part Settings enable CAML-Filtering mode
- Create two Date Filters, both with the same name: that of the date Column to be range-filtered
- for the first Date Filter, specify as its default filter value your preferred initial lower bound of your date range, select "greater or equals" as its operator and Apply your changes
- for the second Date Filter, specify as its default filter value your preferred initial upper bound of your date range, select "less or equals" as its operator and Apply your changes
- Back in the Filter Web Part Settings, in the multi-line text box at the bottom (below the "CAML Filtering Mode" check box) enter just one line: the name you used for both your two Date Filters (from step 3)
That's it! As so often, while there is no "one-click button" for this solution, it's a simple 3-steps process, and trust us, we will keep sharing those insider recipes happily.
Reader Comments