Customizing Data View Query Based on Parameters

Customizing Data View Query Based on Parameters

Post by Ben » Sat, 26 Mar 2005 08:58:10

Hi, I've been attempting to customize a sharepoint data view for a list
interface I've been building. Currently, the list is filtered based on
two search parameters I get for the URL using QueryString. The where
statement in the data query is as follows:

<dsp:Where xmlns:dsp=" ">
<dsp:FieldRef Name="Description"/>
<dsp:Value Type="xsd:string"><udc:ClientParameterValue
xmlns:udc=" "
<dsp:FieldRef Name="Company"/>
<dsp:Value Type="x:string"><udc:ClientParameterValue
xmlns:udc=" "
<dsp:FieldRef Name="IsCurrent"/>
<dsp:Value Type="x:boolean">1</dsp:Value>

What I'm looking to do is add a checkbox in my search form that, if
checked, will also filter the data view by showing only entries
assigned to the current user, but if unchecked, shows all entries. I
attempted to add another statement to the query,

<dsp:Value Type="xsd:string"><udc:ClientParameterValue
xmlns:udc=" "
<dsp:Value Type="x:string">No</dsp:Value>
<dsp:FieldRef Name="AssignedTo"/>
<dsp:Value Type="x:string"><udc:ClientParameterValue
xmlns:udc=" "

This gives an error in FrontPage saying 'The query you are trying to
execute contains syntax errors'. I have tested out the query structure,
and it is fine, the statement giving the problem is the one on the
myItems parameter, if I switch it out, the query works fine, and I have
tested the myItems parameter on its own, it works fine on a standard

Has anyone figured out some way to do conditional filtering like this?
In the past I just used conditional formatting to hide rows that didn't
fit both parameters to achieve the same result, but in this case the
list is very large and limited to displaying 50 results at a time, so
it is conceivable that all 50 results on the first page would be hidden
from the user, which is less than desirable from a UI standpoint. Any
help would be much appreciated.


Ben Anders

1. Data-driven subscription parameter missing default vaule issue for default value query based hidden parameter

2. Query based on a parameter query, Using VBA how to assign the parameters

ADO coding in MS-Access 2002

I have a query (Q2) based on a parameter query (Q1) and need to set the
parameters within a VBA module. I am using ADO, and opening the query (Q2)
as a fordwardonly recordset.

Since Q1 isn't explictly opened in the VBA code, I'm not sure how to set
the parameters.

I do not want to run Q1 to load a table and then have Q2 based on the table
if I can avoid it. Nor do I want to place the parameters in a table and
have Q1 reference them there.

Any suggestions ?


3. Parameter Query based on parameters from another Query

4. Query based on a parameter query, Using VBA how do I set the parameters

5. Query based on a parameter query, using VBA how do I to set the parameters

6. Query saved as data access page.Customising the parameters

7. Report based on parameter query but displays data that it shouldn't.

8. views based on parameter view

9. Queries based on results received from query with parameter values

10. Parameter query based off more than one query

11. Parameter Query Based on Form Input within a Union Query

12. Passing a Query-based Report a Query Parameter

13. Query based on a parameter query, using VBA how do I set the paramters

14. Sync between PWA-view data and data in the project data base

15. Passing parameters to a parameter query from a data access page