0

I have a dataset that populates a drop down list, and the query behind the dataset uses two cascading parameters.

Basically it looks like this:

choose an engine: [drop down list]       //defaults to 0
choose a transmission: [drop down list]  //defaults to 0
list of choices: [drop down list]

The two cascading parameters both have default values of zero in case the user doesn't want to use those parameters.

Shouldn't the default values allow my dataset query for the "list of choices" drop down list to automatically execute?

Or is there something else I need to do?

Thanks

SkyeBoniwell
  • 6,345
  • 12
  • 81
  • 185

2 Answers2

1

I'm not sure I understand the question entirely, but I would say that each dataset needs to take a parameter, which when blank gives all results.

This would be achieved in the SQL script that queries the results you want, perhaps with an if @Param = "" SELECT * FROM tab ELSE SELECT * FROM tab WHERE col = @Param type script. This should allow you to fill each parameter blank in turn, leading to the final one.

Unfortunately, because whatever you do, the second parameter relies on the first and so on (even if only in some cases), you will have to enter the blank value before progressing to the next parameter. However, if you are use something similar to the above when populating the second parameter, the third should select all by default when the second selects all,

High Plains Grifter
  • 1,357
  • 1
  • 12
  • 36
1

If I understand correctly, then a possible problem I see is that your default values 0 don't exist in the list of choices dataset. If the query behind the dataset is something like: WHERE engine IN (@engine) AND transmission IN (@Transmission) then using the Default Value 0 might not return anything. Instead if you want you return all rows then try changing your query to something like:

WHERE (@engine = 0 OR engine IN (@engine))
AND (@transmission = 0 OR transmission IN (@transmission))
Roberto
  • 533
  • 2
  • 10