Dynamically create filename in SSRS 2008

后端 未结 5 2119
南旧
南旧 2021-02-20 03:14

I have been asked a couple times to change the file name dynamically in SSRS 2008. Example: ReportName_201101.RDL. The 201101 represents the execution date. Can this be accom

5条回答
  •  余生分开走
    2021-02-20 03:39

    Here is a correction to the above stored procedure so that it actual works.

    ALTER PROCEDURE [dbo].[ddc_RenameReports]
    
    AS
    SET NOCOUNT OFF ; 
    
      Update dbo.Catalog 
        Set Name = ISNULL((Select OriginalReportName + '_' + 
                   dbo.func_SetupRenameOfReports(DateType, Format, DatePlusMinus)
          From dbo.DDC_Report_Rename r
          Where r.ItemID = c.ItemID And r.Active = 1), Name) 
      From dbo.Catalog c
      Update c
        Set c.Path = ISNULL((Select c2.Path + '/' + OriginalReportName + '_' + 
                   dbo.func_SetupRenameOfReports(DateType, Format, DatePlusMinus)
              From dbo.DDC_Report_Rename r2
              Where r2.ItemID = c.ItemID AND r2.Active = 1), c.Path)       
      From dbo.Catalog c
        inner join dbo.Catalog c2 on c2.ItemID = c.ParentID 
    return (0)
    

提交回复
热议问题