We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Starting in 2019, the Reporting control is no longer included in Essential Studio®. If you're experiencing issues with the Syncfusion Reporting Platform, Report Viewer, Report Designer, or Report Writer, we recommend migrating to Bold Reports, our dedicated reporting platform.

Bold Reports offers a comprehensive suite of tools and features for all your reporting needs, and we will help you make a smooth transition from the discontinued control. Our support team at https://support.boldreports.com/ is here to assist you with any questions or difficulties you may encounter during the migration process.

We thank you for choosing Syncfusion and appreciate your understanding.

ReportViewer export filename

I'm passing the RDL to the control via stream. When I export the report, the filename is always report.pdf, report.xlsx, etc. How can I change that download file name to something more meaningful?

1 Reply

YD Yuvaraj Devarajan Syncfusion Team November 9, 2016 06:52 AM UTC

Hi Richard,   
  
Thanks for contacting Syncfusion support.   
  
We have a “ReportExport” event in ReportViewer control to set the report name dynamically while clicking the reportviewer export option as shown in the following code example,      
 
<script>  
    function onReportExport(args) {  
        //increament file name in JS      
        var _exportName = $(args.exportAction).find('#' + this._id + '_exportfileName');  
        var currentDate = new Date();  
        var date = currentDate.getDate();  
        var month = currentDate.getMonth();  
        var year = currentDate.getFullYear();  
        _exportName.val('DemoReport ' + date + '-' + month + '-' + year);  
  
    }  
</script>  
  
<body style="overflow: hidden; position: static; margin: 0px; padding: 0px; width: 100%; height: 100%">  
    <div style="width:100%; height:100%; position:absolute;">  
        @(Html.EJ().ReportViewer("reportsample")  
        .ProcessingMode(Syncfusion.JavaScript.ReportViewerEnums.ProcessingMode.Remote)  
        .ReportServiceUrl(VirtualPathUtility.ToAbsolute("~/api/ReportApi"))  
        .ReportPath("~/App_Data/GroupingAgg.rdl")  
        .ReportExport("onReportExport")  
        )  
    </div>  
</body>  
 
We have prepared a sample and it can be downloaded from,    

Please refer to the below UG documentation for more information,    

Regards,  
Yuvaraj D.  


Loader.
Up arrow icon