Get Free Trial

Would like to download few columns only while exporting to pdf, csv, excel, html

shilpi asked on April 16, 2020

Hi Team,
I am successfully able to integrate flexmonster. However, I would like to know how can I download only few columns while doing export. In my grid I have 30 columns, but while download I want only 10 to be present with no impact on grid.

5 answers

Illia Yatsyshyn Illia Yatsyshyn Flexmonster April 16, 2020

Hello, Shilpi,
Thank you for your question.
We would like to kindly explain that all information chosen for the current report will be exported.
In case only its part should be exported, the configuration can be changed in an appropriate way before exporting.
One of the possible approaches is to apply such changes right before the exporting is started and roll them back after export is complete.
It is possible to track those processes using the exportstart and exportcomplete events.
You are welcome to find out more about the mentioned events from our documentation:

We hope it helps.
Do not hesitate to contact us in case of additional questions.
Kind regards,

shilpi April 18, 2020

Hi Illia,
How to call these methods in angular?
Do they need to be called from onPivotReady() method or we can pass from html like

<fm-pivot #pivot [licenseKey]=”flexmonsterKey” 
            (beforetoolbarcreated) =  “customizeToolbar($event)”
            (reportcomplete) = “reportcomplete($event)”
            (exportstart) = “exportstart($event)”

Can you please demonstrate as per angular, how to call the methods and filter the columns.

shilpi April 20, 2020

H Illia,
Any update on above request?. It is bit urgent, I have to remove few columns before export starts.

shilpi April 21, 2020

Please help us to provide solution in angular. How to remove column while export.
Awaiting for your response.

Illia Yatsyshyn Illia Yatsyshyn Flexmonster April 21, 2020

Hello, Shilpi,
Thank you for giving us some time.
We would like to kindly draw your attention to the following code snippet:

exportHandler(): void {
    const slice = <Flexmonster.Slice> this.pivot.flexmonster.getReport().slice;
    this.pivot.flexmonster.on("aftergriddraw", () => {"aftergriddraw");
      this.pivot.flexmonster.exportTo("pdf", {}, () => {

It allows exporting the grid right after required columns were excluded using the runQuery method (marked in bold). After the export is finished, the previous slice is applied.
We hope it works.
You are welcome to contact us in case of additional questions.
Kind regards,

Please login or Register to Submit Answer