0

我的报告中有一个名为报告级别的参数,您可以在其中从 4 个选项中进行选择:

公司 BDM 地区站点

我想要做的是:

选择 BDM,这将打开另一个参数调用 BDM 列表(这基于从查询中获取值),但我希望其他参数保持灰色。一旦从 BDM 列表中做出选择,时间和日期参数就会变得可用。

这可能吗?

这些是我的 BDM 列表和区域列表的数据集:

    SELECT SiteInfo FROM
    ((SELECT DISTINCT BDM, Region, SiteName As SiteInfo 
    FROM Site 
    WHERE @ReportingLevel = 'BDM' 
    union all
    SELECT DISTINCT BDM, Region, SiteName As SiteInfo 
    FROM Site 
    WHERE @ReportingLevel = 'Region' ) 
    union all
    SELECT DISTINCT BDM, Region, SiteName As SiteInfo 
    FROM Site
    WHERE @ReportingLevel = 'SiteName') AS QRY2

这是我的主要数据集:

    SELECT       OccupancyDetail.CalendarYear, OccupancyDetail.CalendarMonth, SUM(OccupancyDetail.No_of_Nights) AS No_of_Nights, 
                         SUM(OccupancyDetail.Capacity) AS Capacity
FROM            OccupancyDetail INNER JOIN
                         Site ON OccupancyDetail.Site_Skey = Site.Site_Skey

WHERE  (OccupancyDetail.ReferenceDate = convert(Date,getdate()))
AND CASE WHEN @Time = 'YEAR' THEN CAST(CalendarYear as varchar(4)) else CalendarMonth + ' ' + CAST(CalendarYear as varchar(4)) end in (@Dates)
AND Site.BDM IN (@BDM)
AND Site.Region IN (@Region)
AND Site.SiteName IN (@SiteName)


GROUP BY OccupancyDetail.ReferenceDate, OccupancyDetail.CalendarYear, OccupancyDetail.CalendarMonth

时间数据集

select DateChoice FROM
(select distinct CalendarYear, 1 as MonthNumber,CAST(CalendarYear as varchar(4)) as DateChoice from Time
where @Time = 'YEAR'


union all

select Distinct CalendarYear, MonthNumber,CalendarMonth + ' ' + CAST(CalendarYear as varchar(4)) as DateChoice from Time where @Time = 'MONTH') as QRYDATA
ORDER BY CalendarYear,MonthNumber

我希望你能帮助这是我工作的第三天。

谢谢

韦恩

4

1 回答 1

0

我相信您正在寻找使用级联参数,这里有一些链接应该可以帮助您。

http://technet.microsoft.com/en-us/library/dd255197.aspx

http://thevirtualzoneblog.wordpress.com/2011/03/30/creating-cascading-parameter-reports-using-sql-server-reporting-services-v2008/

通过第一个链接,转到标记为“创建数据集以提供相关参数值”的部分。下一个在父级选择选项之前将参数显示为灰色:

http://www.resultdata.com/adding-cascading-parameters-to-a-ssrs-report/


更新

我为您找到了一个视频教程: http ://www.youtube.com/watch?v=VAYGupJcHkU

于 2013-03-08T12:29:10.380 回答