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

Export filename in new version.

When exporting the file from report viewer the downloaded filenames are defaulted to the report.pdf etc.

I've taken a look at https://www.syncfusion.com/forums/127285/reportviewer-export-filename but it seems the data is outdated. I've tried to use add a similar method by using the following:

onExportReport(args){
      args.formValues = [
          {
               key: "exportfileName",
               value: "RenamedReportName"
          }
     ];
}

but it doesn't seem to have any effect on the exported filename. How should I change exported filename in the new version of this control?


4 Replies

DA David March 31, 2019 11:48 PM

Forgot to mention in the actual report viewer control I've already set reportExport option to the above function


MM Mageshyadav M Syncfusion Team April 1, 2019 12:58 PM

Hi David, 
 
We have provided the solution for changing the export file name as like a workaround in earlier. Now, we have changed the support as properly in report viewer with event argument. Please make use of the exportItemClick event to change the file name of the exporting document from 17.1.0.38 version as shown below. 
 
    <script type="text/javascript"> 
        $(function () { 
            $("#viewer").ejReportViewer( 
                { 
                    reportServiceUrl: "/api/ReportsApi", 
                    reportPath: '~/App_Data/SalesOrderDetail.rdl', 
                    exportItemClick: "onExportItemClick", 
                }); 
        }); 
        function onExportItemClick(args) { 
            args.fileName = 'DemoReport'; 
        } 
    </script> 
 
But we have found some issue in updating filename hence we have generated the updated script patch file in version 17.1.0.38 which can be downloaded from below location, 
 
 
Regards, 
Mageshyadav.M 



DA David April 1, 2019 11:26 PM

Thanks Mageshyadav, I have confirmed that this works with the new patch. I also humbly suggest adding this detail to the documentation for report viewer export once this fix gets into the main branch.


MM Mageshyadav M Syncfusion Team April 2, 2019 12:34 AM

Hi David, 
  
We will update this detail in documentation for Report Viewer Export asap and we will include this fix in our next weekly nuget to be rolled out on April 9, 2019. 
  
Regards, 
Mageshyadav.M 


Loader.
Live Chat Icon For mobile
Up arrow icon