【问题标题】:Handling empty values in SSRS处理 SSRS 中的空值
【发布时间】:2020-08-11 18:52:05
【问题描述】:

您好,我正在使用 Microsoft 报告服务构建查询

我想知道如何只对具有值的子报表执行子报表。

WHERE        (QuoteDtl.PartNum = @SRPartNum) AND (QuoteHed.DateQuoted <= N'2020-06-26') AND (QuoteHed.ExpirationDate >= N'2020-07-26') AND (QuoteHed.ShipToNum = @SRShipToNum) AND 
                         (QuoteHed.CustNum = @SRCustNum) 

@SRShipToNum & @SRCustNum 并不总是有价值,当它没有价值时,我会在我的报告中得到这个

https://i.stack.imgur.com/w5ftJ.png

我也不知道日志文件在哪里

【问题讨论】:

  • 您可以在此文件夹中找到 SSRS 托管服务器上的日志文件 -> C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\LogFiles
  • @Harry 我遇到的问题没有日志文件。

标签: reporting-services report ssrs-2012 reportingservices-2005


【解决方案1】:

我认为你需要做的是像这样稍微修改 where 子句

WHERE        
(QuoteDtl.PartNum = @SRPartNum) 
AND (QuoteHed.DateQuoted <= N'2020-06-26') 
AND (QuoteHed.ExpirationDate >= N'2020-07-26') 
AND ((QuoteHed.ShipToNum = @SRShipToNum) or isnull(QuoteHed.ShipToNum ,'')='')
AND ((QuoteHed.CustNum = @SRCustNum or isnull(QuoteHed.CustNum,''='' ) )

然后在您的报告前端,确保为您的 @SRShipToNum@SRCustNum 参数打勾:

【讨论】:

  • Error in list of function arguments: '=' not recognized. Error in list of function arguments: 'ISNULL' not recognized. Unable to parse query text. 这就是我得到的。
  • 能否将完整的 sql 查询显示为问题中的文本(请编辑问题的详细信息,而不是其他评论)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-06-05
  • 2014-02-09
  • 2012-05-23
  • 1970-01-01
  • 2015-10-27
  • 1970-01-01
  • 2018-08-02
相关资源
最近更新 更多