Report Parameters (stored procedures) with Parameters

  • OK, I have a report with a stored proc dataset that has several parameters.

    I have set up each of these parameters as it's own stored proc dataset - each of these stored procs have the same parameters as the report dataset stored proc so that say, I select the city parameter = Seattle, then the state parameter will automatically filter to only give me the option of WA instead of selecting Seattle and then being able to select NY as the state.

    Sounds good, in theory, right?  The problem is that if I add any of the parameter datasets (the stored proc with the parameters), reporting services freaks out and gives the following error:

    "The report parameter 'City' has a DefaultValue or ValidValue that depends on the report parameter 'State'. Forward dependencies are not valid."

    This same error occurs if I don't use the parameter stored procs at all, but just use the report stored proc for the parameter query too.

    I don't know if I'm making any sense.

    I guess the next step is to use a VS.Net web form and pass the parameters, but since I am not proficient in VS, I was trying to take advantage of RS features.

    Any suggestions would be appreciated.

    Thanks, Megan

  • Hello,

    If I understanded you , you have parameters which dependend between them. I think this is the problem ... I think that you have to have a parameter which is loaded with the State dataset and when you select one option of this dropdown the city dropdown will be filter. So City depends on the state choosen and to the report dataset depends on state and city as report parameters.

    State Dataset : select State_ID, State_Name from State_Table

    City Dataset: select city_ID,city_name from city_Table where state_ID= @parameters!state.value

    report Dataset: select * from table where city_ID= @parameters!city.value and state_ID= @parameters!state.value

    I don't know if I understand your problem but I hope this helps...

     

     

  • Hey Megan,

    If you go to the parameters dialog box (right click the black square at top left of/in design view and select parameters) you'll see your report parms.  There should be buttons to move the parms up and down - so move you state above your city parm and then so on.

    Cheers and HTH,

    Steve.

  • Thanks guys. 

    Unfortunately, in my case, it's not as simple as city, state, and I would like the user to be able to select any parameter and by selecting that parameter, the other parameters will be filtered - there isn't necessarily an order in the filtering.

    May be I'm just trying to do something in the wrong way.

    For now, I just set it so that the parameters show all values.  So, now, the user can select "Seattle" and "New York" and no records will be displayed.  When I get up to speed, I'll move the parameters to a VS web form and hopefully, that will give me the functionality I desire.

    Thanks again.

    -Megan

  • Hey megan,

    From what I can tell, if your parms don't have some one-way dependancies (like Country to State, State to City; Category to Sub Category etc etc) then you'll prob have to go down the custom web form path as you'd guessed.

     

    Steve.

  • Thanks Steve.

  • Hi everyone;

    I just found a solution to this problem. if you go to report>report parameters you will see the orders of parameters. if you put the sub parameter to the top. this problem will be fixed.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply