Cascading Parameters

天涯浪子 提交于 2019-12-11 04:27:15

问题


I have looked at various ways of doing this but cant seem to implement it correctly.

I have a 3 parameter report in SSRS

@County @LocalAuthority @Ward

I want these parameters cascading. So when @county is chosen @LocalAuthority only displays local authorities within that county. And when local authorities are chosen only the wards in those authorities appear.

the County to Local Authority is working but Local Authority to Ward isn't. The correct wards are showing in the drop down parameter but they are not filtering by ward in the actual report.

I am using stored procedures. This is my main dataset

  @County varchar (5),
  @LocalAuthority varchar (max),
  @Ward varchar (max)

   SELECT

             [DateTimeOfCall] 
            ,HourOfDay 
        ,[ConcatAddress] 
        ,[LocalAuthority]
        ,[Ward] 
        ,[County] 
        ,[PropertyType]

FROM table1

WHERE   [County] = @County AND [LocalAuthority] = @LocalAuthority and 

[Ward] in @Ward

2nd dataset for local authority

    @County varchar (5)       

         SELECT DISTINCT

                LocalAuthority,
        county              

              FROM table1

  WHERE [County] = @County

and a final dataset for Ward

         @LocalAuthority (max)

        SELECT DISTINCT


        Ward,
        LocalAuthority 


              FROM table1

       WHERE [LocalAuthority] = @LocalAuthority

Many Thanks


回答1:


Try this instead of ward in @ward if you wanted to get the dataset via stored procedure:

CHARINDEX(','+ward+',', ','+@ward+',') > 0


来源:https://stackoverflow.com/questions/39918049/cascading-parameters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!