We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

How to set export file name

Answered
Alberto Nudman asked on September 14, 2017

Hi,
I need to set the export file name, so that when the user exports, gets an Excel file with a name that says something. I know there is a way to do it through a button, but it would be better if I could set it up in the report's definition
Thanks

7 answers

Public
Ian Sadovy Ian Sadovy Flexmonster September 14, 2017

Hello Alberto,
 
Thank you for the question.
Actually, you can set export file name only by passing it to the exportTo API call.
So, there is no option to set it in the config file.
Please let me know if you have any other questions.
 
Regards,
Ian

Public
Lukas Navratil September 14, 2017

Hi,
I just want to add that it would be also useful for us to have some config option where we could set the default export filename (e.g. common for all export types, Flexmonster would just add extension based on the export type). Otherwise we would have to recreate whole export menu with our custom implementations that would just call API with proper export filename and Excel sheet name...
Regards,
Lukas

Public
Tanya Gryshko Tanya Gryshko Flexmonster September 15, 2017

Hello Lukas and Alberto,
Thank you for writing to us. We have added this request to our customers' wish list. However, we are not able to provide you with an estimated timeframe for implementation of this feature. We will notify you about any updates on the subject. Let me know if you have other questions.
Regards,
Tanya

Public
John Armstrong June 13, 2019

A global config to set file names, sheet names, etc would be great! 🙂

Public
Vera Didenko Vera Didenko Flexmonster June 14, 2019

Hello, 
 
Thank you for pointing this out to us.
 
We would like to mention that our roadmap is full at the moment, however, our team agrees that this is a nice feature to have.
 
We have added your request to our customers' wish list and we will inform you in case of any changes on the matter.
 
Please let us know if you have any further questions.
 
Best Regards,
Vera

Public
shilpi April 16, 2020

Hi Team,
 
Is this feature available now? configuration to setup the custom export name?
 
Regards
Shilpi

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster April 16, 2020

Hello, Shilpi,
 
Thank you for your question.
 
We would like to kindly inform you that the custom export name can not be changed through the configuration, however, in can be defined using the filename property of the second parameter of the exportTo method.
More information about the exportTo API call and its parameters can be found in our documentation.
 
In case it is required to replace the Toolbar controls dedicated to exporting instead of creating own ones, we can recommend using the approach, demonstrated in the following example.
 
Our team would like to provide some additional explanation about the following code snippets from the sample mentioned above.
The following function is the handler which is going be used for exporting:

function exportHandler(params) {
pivot.exportTo(params.type, params.config)
}

The following block is responsible for replacing the handler of an appropriate button with a newly created one and set desired arguments that are going to be passed into handler using the args property.

function customizeToolbar(toolbar) {
var tabs = toolbar.getTabs();
toolbar.getTabs = function() {
tabs[3].menu[1].handler = exportHandler;
tabs[3].menu[1].args = {
type: 'html',
config: {
filename: 'Custom filename for HTML'
}
}
...

 
We hope it works for you.
Do not hesitate to contact us in case additional questions occur.
 
Kind regards,
Illia

Please login or Register to Submit Answer