I used setOptions to change the grid type to flat, but it refreshed the whole report before exporting.
this is the code
let options = this.pivot.flexmonster.getOptions();
options.grid.type = 'flat';
Thank you for posting your question.
Due to the structure of the component, it is necessary to refresh the pivot table for the new options to take effect.
Perhaps you could tell us a bit more about your use case so that we can provide a more relevant solution if one exists?
Looking forward to your response.
I want to export CSV reports in a flat layout.
Our apologies for the delayed response.
In this case, there is not much we can recommend – as I’ve previously mentioned, refreshing the pivot table is necessary after using the
setOptions() API call.
If you don’t want your Flexmonster instance to change merely for exporting, consider the following workaround: create a copy of your Flexmonster instance, configure it for exporting, perform the export and then remove the copy from the page.
Please let us know if there is anything else we can help you with.
I like this workaround, could you please provide a fiddle on how to do it right?
Please see the following JSFiddle sample illustrating the suggested approach: https://jsfiddle.net/flexmonster/9v2xdoyn/.
Do you think something like this would work for you?
We would be happy to hear your feedback.
How are you?
Just checking in to ask if you’ve found our sample helpful. Does this approach work fork for you?
Please let us know your thoughts.
Hope you’re doing well!
Have you had a chance to check out the sample we’ve sent you earlier? Was it helpful?
We’d be happy to know what you think.
It created another flexmonster below the original flexmosnter, so I used the approach of going back to the compact layout like this
1-change to flat
2-export as flat
3-go back to compact
Thank you tho, it was a great idea.