Stump the Panel » End Users and Information Workers

Filter DataView on [potentially!] multiple form values

(2 posts)
  1. Hi All,

    Here is my question:

    I have a large contacts list. I wish to use a form web part to collect filter values as a kind-of search function:

    i.e. The user can enter a complete (or fragment of) first name and/or last name and/or department (perhaps from a drop down) and hit 'Go' to get the filtered results.

    I have this working fine using a form web part connected to parameters in a dataview for FirstName begins with OR LastName begins with [Parameter].

    I would like this to work with an AND operator, unless the field is blank.

    It's that last bit that is stumping me...

    It may be that XSLT Filtering can help by evaluating the cotent of the parameter, but I don't know this very well esp not the concept of wildcards from the data?

    All your help much appreciated!

    Thanks
    Ben

    Posted 4 days ago #
  2. Hi there, back again - with a slightly different question:

    Solution to the above was to use the following XSLT Filter on the DataView.

    [(@FirstName[starts-with(.,$Param1)] or $Param1 = '*') and (@Title[starts-with(.,$Param2)] or $Param2 = '*')]

    Which allows full, partial or wildcard '*' entries in my fields...

    The next hurdle is that the above is case sensitive -- david returns 0 David returns 3!

    I am hoping that some passing XPATH or XSLT bod will be able to point me in the right direction- - essentially I want to ignore case by uppering or lowering both the field content and the parameter?

    Thanks
    Ben

    Posted 4 days ago #

RSS feed for this topic

Reply

You must log in to post.