How to customize the Excel export file name

When exporting your DataTables View to an Excel file, the default file name combines the View name and your website name.

Add your preferred file name on line 3 between the single quotes:

add_filter( 'gravityview/datatables/button_excel','gravityview_excel_export_settings', 10 ,2 );

function gravityview_excel_export_settings( $button_config = array(), $view_id ) {
	$button_config['filename'] = 'YOUR-NEW-FILENAME-HERE';
	$button_config['title'] = '';
	return $button_config;
}

If you're not sure where to add code samples, please see the following article: Where to put code samples

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us