Search results
Suggest a FeaturePDF

How to change the exporting document file name based on parameter

Find the following steps to change the file based on parameter values in Report.

  1. Create the file exporting file name using the parameters in onRenderingComplete event and store it in local variable.

    function onRenderingComplete(event) {
       var parameters = event.reportParameters;
       if(parameters){
       for (var i = 0; i < parameters.length; i++) {
         if(parameters[i].Name == "Department"){
           this.exportFileName = "Sales for " + parameters[i].Value;
         }
     }
  2. Use the file Name property with export, click event to change the file using the value stored in local variable used for having the file using the parameters.

      function onExportItemClick(event) {
          event.fileName =  this. exportFileName ;
      }