Click here to Skip to main content
15,920,217 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

My problem is that by default excel name display same as my RDL Name while use "Export to Excel" option in SSRS. Suppose my RDL name is "test.rdl", used to export to excel option then it is displayed "test.xls" but I want to generate it dynamically like "test_databasename.xls".
Posted

1 solution

Follow below points

1. Connect to your Report Server from SSMS.

2. Note the ItemID for your report by executing this query

SQL
select *
from ReportServer..Catalog
where Path like '%NameofyourReport%'


3. Create a job in here with the name say "AppendDatetoxyzreport" and add a step in it with the code

SQL
UPDATE [Catalog]
SET [Path] = '/PathofyourrerportfromReportServer/ReportName_' + CONVERT(VARCHAR(8), GETDATE(), 112),
    [Name] = '/ReportName_' + CONVERT(VARCHAR(8), GETDATE(), 112)
WHERE ItemID ='<itemid>'</itemid>


4. Create another job with a name like "RemoveDatexyzreport" and add a step in it with the code

SQL
UPDATE [Catalog]
SET [Path] = 'PathofyoureportinReportserver/ReportName',
    [Name] = 'ReportName''
WHERE ItemID = '<itemid>'
</itemid>


5. Now set your AppendDatetoxyzreport job schedule to execute first, then the Report's subscription and then the RemoveDatexyzreport.

Source:

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/ddfd922b-613a-49f3-b403-b70cd66a8127/append-date-to-exporting-file-name-in-sql-reporting-service[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900