SSRS report - automatically download with specific name

Zolotoy 226 Reputation points
2021-05-12T17:15:48.15+00:00

If I specify format parameter (PDF) I get a report in PDF format automatically downloaded. Is it possible also provide a file name?

Thanks

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,063 questions
0 comments No comments
{count} votes

Accepted answer
  1. Olaf Helper 47,441 Reputation points
    2021-05-14T07:02:47.033+00:00

    automatically downloaded. Is it possible also provide a file name?

    The download is done by the browser, not by SSRS; no, you can not pass a filename.

    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Joyzhao-MSFT 15,636 Reputation points
    2021-05-13T05:41:45.01+00:00

    Hi @Zolotoy
    As far as I know. I think it is impossible to export the pdf report with the specified file name in SSRS.
    Best Regards,
    Joy


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Joyzhao-MSFT 15,636 Reputation points
    2021-05-13T06:58:02.527+00:00

    If you want to create downloaded file name dynamically in SSRS reports, you could try this code:

    ReportViewer.ServerReport.DisplayName = <Your Parameter Value>;  
    

    This code is only applicable if you are using report viewer control in your application (web or windows) to display reports. If your are using SSRS in standalone way, there is no way to achive this.
    Joy


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. Zolotoy 226 Reputation points
    2021-05-13T09:28:53.2+00:00

    I am getting: ReportViewer is not defined.

    I am trying this code:
    <rsweb:ReportViewer ID="ReportViewer1"

    document.getElementById('ReportViewer1').ServerReport.DisplayName = "test.pdf"
    

    it's not failing but not doing anything.

    0 comments No comments

  4. Zolotoy 226 Reputation points
    2021-05-13T14:25:34.263+00:00

    Does it only work for RDLC reports?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.