Table functions > Exported file
Crud Elite
Action Column
Table functions
Common issues
Other
How it works
How can you change the exported file's name? By default, the exported file follows the ViewBag.Title
. However, you might want to customize the filename to reflect something more relevant. Here’s how to set a different name for your exported files.
You can change the data-filename
value in /Views/Home/Index.cshtml
.
The code in the first image below will name the exported file Client-CurrentDateTime
. (You can try in the live demo) Where is the code that sets the CurrentDateTime? You can refer to the second image below. It’s in wwwroot/js/auratheme.table.js
.
Before removing current date time (original code):
XLSX.writeFile(wb, `${renderTableDiv.getAttribute("data-filename")}-${getCurrentDateTimeForFileName()}.xlsx`);
After removing the current date time from the file name:
XLSX.writeFile(wb, `${renderTableDiv.getAttribute("data-filename")}.xlsx`);