SSRS - 单击“查看报告”按钮可将焦点返回到具有未设置值的参数

时间:2015-12-08 18:36:56

标签: reporting-services parameters

我尝试在Report中设置SSRS 2012,设置完毕,所有代码都在SSMS中正常运行。但在SSRS我得到以下内容:

  1. 填写所有参数
  2. Report Header with all Parameters selected

    1. 按查看报告

    2. 出现以下内容

    3. Report Header after View Report 如您所见,ToDate参数字段再次要求输入值。 以下是参数的代码:

      财政参数

      SELECT  
          FiscalPeriodId
          ,FiscalPeriodName + ' - ' + [Status] + ' ' + Convert(varchar(15),ENDDate, 101) AS FiscalPeriodName   
          ,FiscalPeriodId AS OrderId
      FROM fin.FiscalPeriod 
      WHERE Status = 'Closed'  
          AND GeneralLedgerGroupId = @Location
      
      UNION 
      
      SELECT  
          FiscalPeriodId
          ,'Current'
          ,9999999 AS OrderId
      FROM fin.FiscalPeriod
      WHERE Status IS NULL 
          AND GeneralLedgerGroupId = @Location
      
      UNION
      
      SELECT 
          0 AS FiscalPeriodId
          ,'AS of Specified Date' AS FiscalPeriodName
          ,10000000 AS OrderId
      ORDER by OrderId DESC
      

      日期参数

      SELECT 
          CASE 
              WHEN fp.ENDDate IS NULL 
                  THEN GETDATE()
                  ELSE fp.ENDDate
              END AS ToDate
      FROM fin.FiscalPeriod fp
      WHERE FiscalPeriodID = @FP 
      
      UNION
      
      SELECT 
          CASE 
              WHEN @FP IS NULL 
                  THEN GETDATE()
                  ELSE NULL 
              END AS ToDate
      ORDER BY ToDate DESC
      

      我在网上搜索过,发现Stackoverflow上有一个问题似乎是同一个问题,但没有答案(2012)。有什么建议吗?

0 个答案:

没有答案