【发布时间】:2020-01-14 11:07:35
【问题描述】:
我正在 SSRS 中创建报告。查询工作正常。如果我对输入值进行硬编码,我会得到结果。
现在我添加了三个参数:
- 年月
- SUG 名称
- 收藏
- YearMonths - 数据直接来自 SQL 查询。没有问题。
-
SUGName -
select cia.AssignmentID,CIA.Collectionid, concat(grp.Title,' -- ', CIA.CollectionName) as deploymentName from v_CIAssignment cia inner join v_CIAssignmentToGroup atg on cia.AssignmentType=5 and atg.AssignmentID=cia.AssignmentID inner join v_AuthListInfo grp on cia.AssignmentType=5 and grp.CI_ID=atg.AssignedUpdateGroup where concat(datepart(yyyy, grp.DateCreated), '-', RIGHT('0' + RTRIM(MONTH(grp.DateCreated)), 2)) = @YearMonths Order By grp.Title desc这也有效。
-
收藏-
select cia.AssignmentID,CIA.Collectionid, concat(grp.Title,' -- ', CIA.CollectionName) as deploymentName from v_CIAssignment cia inner join v_CIAssignmentToGroup atg on cia.AssignmentType=5 and atg.AssignmentID=cia.AssignmentID inner join v_AuthListInfo grp on cia.AssignmentType=5 and grp.CI_ID=atg.AssignedUpdateGroup where cia.AssignmentID = @SUGName Order By grp.Title desc它不工作并给出错误。查询工作正常。我通过手动输入 SUGName 进行了检查。
以下是我遇到的错误。
System.Web.Services.Protocols.SoapException: 查询参数“@SUGName”的值表达式引用了一个不存在的报告参数“SUGname”。参数名称中的字母必须使用正确的大小写。
【问题讨论】:
-
错误消息暗示您没有在 ssrs 参数或数据集中(参数映射选项卡或类似的东西)中声明
@SUGName参数。或者,您的查询或参数定义中的@SUGName可能有错字。
标签: sql reporting-services ssrs-2012