Need to rename filename while exporting

Hi,

I want to know that how to rename filename while export from chart or grid.?
 i tried below function but it's didn't work.

 grid.toolbarClick = function (args) {
if (args.item.id === 'dvManageIncentives_pdfexport') {
                    var exportProperties = {
                              filename : "NewName.pdf"
                              }
grid.pdfExport(exportProperties
);
}

};


1 Reply

VA Venkatesh Ayothi Raman Syncfusion Team August 20, 2018 11:13 AM UTC

Hi Jignesh, 

Thanks for contacting Syncfusion support. 
 
Query #1 : I want to know that how to rename filename while export from grid? 
 
We have analyzed your query and we found that the cause this issue is the property called fileName is misspelled as filename in your code snippet. Please change the property name as fileName to change the name of exported pdf in the grid. Please refer to the below sample for your reference. 

Code Example

[.ts] 
... 
grid.toolbarClick = (args: ClickEventArgs) => { 
        if (args.item.id === 'Grid_pdfexport') { 
          var exportProperties = { 
                //you can customize the name as per your requirement  
                fileName: 'newfile.pdf',          
             }; 
            grid.pdfExport(exportProperties); 
        } 
    }; 
... 
 


Please get back to us for further assistance. 
 
Query #2 : I want to know that how to rename filename while export from chart? 
 
Your requirement can be achieved easily. In the export method of chart, you need to pass the file type and name of the file. So, here you can pass the required file name dynamically. You can find the online demo sample from  here.   
In the online demo sample, we have text box, where you can give the required file name and export the chart. For more information on exporting chart, find the help document.  
 
Regards, 
Venkatesh Ayothiraman. 


Loader.
Up arrow icon