This is a migrated thread and some comments may be shown as answers.

Custom filename broken?

1 Answer 319 Views
Excel Export
This is a migrated thread and some comments may be shown as answers.
Philipp
Top achievements
Rank 1
Philipp asked on 12 Nov 2020, 03:14 PM

Hello,

I'm currently trying to export an excel file from a grid with a custom filename. Everywhere I look the go-to suggestion is to use the

ExcelExportEvent

and 

e.workbook.fileName

to update the file name. This doesn't appear to work anymore. Looking into the source code I found the following lines trying to save a file:

saveFile(options) {
toDataURL(options).then((dataURL) => {
saveAs(dataURL, this.fileName, {
forceProxy: this.forceProxy,
proxyURL: this.proxyURL
});
});
}

 

This clearly indicates that this.fileName is used, which is initialized once to "Export.xlsx" and then never read back from the event again.
Is this intended behaviour? If so, has the ability to override the export name completely been removed?

Best Regards
Philipp

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 16 Nov 2020, 08:03 AM

Hello Philipp,

The file name of the exported file is usually set via the fileName input property of the kendo-grid-excel component (here's a ref to the docs article). And here's an example of setting a custom name in action.

<kendo-grid-excel fileName="custom-name.xlsx"></kendo-grid-excel>

Could you please send me a link to the docs article where the reported not working mechanism of changing the file name is described, so I can investigate the issue?

Looking forward to your reply.

Regards,
Dimitar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Excel Export
Asked by
Philipp
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or