从SSRS报告

时间:2017-06-09 10:13:55

标签: reporting-services ssrs-2008-r2

我创建了一个SSRS报告,其中有一个名为Attachment的列,我想显示一个链接,点击后会下载相应的附件

我使用过这个接受不同参数的程序:

alter proc [dbo].[getLessonLearntDetails_New_Test]
@AssetID nvarchar(50),
@DepartmentID varchar(50),
@Category varchar(50),
@AuditType varchar(50),
@AuditStartYear nvarchar(50),
@AuditEndYear nvarchar(50)

as
begin
select row_number() over(order by AssetName asc) as Sno
      ,LLD.LessonComputedID
      ,tbl_Asset.AssetName
      ,AT.AuditType
      ,SY.Year+' - '+EY.Year as 'Audit Period'
      ,DE.DepartmentName
      ,CT.CategoryName
      ,LLD.Learnings
      ,LLD.RepeatedObservationReference
      ,Att.Attachment
from tbl_LessonLearntDetails as LLD
    inner join tbl_Category as CT
        on CT.CategoryID = LLD.Title
    inner join tbl_Asset
        on LLD.AssetID = tbl_Asset.AssetID
    inner join tbl_Department as DE
        on LLD.DepartmentID = DE.DepartmentID
    inner join tbl_AuditType as AT
        on LLD.AuditTypeID = AT.AuditTypeID
    inner join tbl_Attachment as Att
        on LLD.LessonLearntID = Att.LeassonLearntID
    inner join tbl_AuditYear as SY
        on SY.Year = LLD.AuditStartYear
    inner join tbl_AuditYear as EY
        on EY.Year = LLD.AuditEndYear
where ( (('0'=@AssetID and (1=1)) or LLD.AssetID=@AssetID) and 
        (('0'=@DepartmentID and (1=1)) or LLD.DepartmentID=@DepartmentID) and
        (('0'=@Category and (1=1)) or LLD.Title=@Category) and
        (('0'=@AuditType and (1=1)) or LLD.AuditTypeID=@AuditType) and
        (('0'=@AuditStartYear and (1=1)) or (lld.AuditStartYear between @AuditStartYear and @AuditEndYear or lld.AuditEndYear between @AuditEndYear and @AuditStartYear) and
        (('0'=@AuditEndYear and (1=1)) or lld.AuditEndYear between @AuditEndYear and @AuditStartYear or lld.AuditEndYear between @AuditStartYear and @AuditEndYear))
    )
end

1 个答案:

答案 0 :(得分:0)

如果是可通过网址打开的链接,您可以转到文本框属性 - >行动 - >转到网址 - >选择URL并执行表达式,并将此类内容放在:

=" javascript:void(window.open('"& Fields!GoToThisURL.Value&"',' _blank' ))"

字段!GoToThisURL.Value将是您想要包含我认为的.pdf扩展名的完整URL值。