Question

So I have two combo boxes, box1 and box2. The requirement from within SSRS is if box1 is selected set Box2 to None and if box2 is selected then set box1 to none. Now I don't think this is possible because you can only cascade parameters in one direction. Otherwise you get forward dependencies are not valid.

But the question becomes can I validate the boxes when they click View Report to display a msgbox saying Please either choose box1 or box 2 but not both

Note: I am still working in 2005.

Was it helpful?

Solution

As far as I know, View button code cannot be accessed. As a workaround, you can do the following:

  1. Add a textbox in your report and let the text be something like "Please enter either cmb1 or cmb2" .

  2. Now from the Database check if both Values are entered. If yes, just return the columns in your select statement as NULLs or specify a value e.g. EMP_NO = 9999.

  3. In your report if the returned value for EMP_NO is 9999 by checking FIRST(fields!xx.value ) = 9999 you can determine what did the user enter.

  4. Add an condition to the textbox visibility checking if the value is 9999 or not, do the same for other items in the report to hide them and just show the textbox.

This can be used for other validations as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top