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
If you became a customer of the Syncfusion Reporting Platform or the Report Viewer, Report Designer, or Report Writer components before October 2019 and have questions related to those products, you can request support through our forum system. However, please note that this support system is only for existing customers who are still using the Syncfusion Reporting Platform or its components and not for new customers looking for reporting products from Syncfusion.

For new customers or those with general reporting questions, we recommend contacting our support team at https://support.boldreports.com/, which is a separate brand created by Syncfusion for its reporting solutions. Our team will be happy to assist you with any questions you may have.

Thank you for choosing Syncfusion for your reporting needs.

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 April 1, 2019 04:48 AM UTC

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 05:58 PM UTC

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 2, 2019 04:26 AM UTC

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 05:34 AM UTC

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