I've had good luck with driving reports with cascading parameters and parameters with defaults. So far though, I've been unable to combine these concepts. Using the example mentioned in BOL, I'd like to have a division parameter choice drive a department parameter dropdown. When the department dropdown is populated, is there any way to specify a default value? So far, my attempts to do so have failed - with no default being chosen and no errors appearing.
I was able to use defaults with cascading parms. In my scenario, I wanted the user to choose the division (I'm actually using something else), but then have the option to choose the department. Basically, the report would show data for the entire division if the department parm wasn't choosen. The only way I could get this to work was to use a default for the department parm. I set the default to "non-queried" and the formula equal to ="" (and empty string). Also, the department parm is checked off to allow null and blank values. At first this didn't work because the default value must be a valid value in the department dataset that populates the dropdown. My fix was to union in a select statement tothe dataset with the default empty string value. Here's that sql: SELECT '' DeptID, '' DeptName UNION ALL SELECT DeptID, DeptName FROM DeptTable WHERE DivID = @DivID ORDER BY DeptName Now, when the division dropdown is choosen, the cascade parm populates the department dropdown. But since the default is set to "", and "" is a valid choice in the recordset - RS is happy. The only thing else I had to do was have the actual report dataset know how to handle the department as an empty string. No biggie. Mike, to apply this to your scenario, I think the key is making sure the default value is always in the dataset for the dept dropdown. Hope this helps, Frank
Don't see what you're looking for? Try a search.
|