Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

Export PDF graph : showFilters

Resolved
Seekme asked on May 11, 2020

Hi,
The showFilters option works well when I export the grid in PDF but it doesn’t show filters when I export any chart in PDF, is it possible to do it ?
Thanks.

5 answers

Public
Seekme May 11, 2020

Also, when I export in PDF with multiple filters like multiple month, I don’t have the detail like un .xlsv export, it just says “multiple items”, can I change that ?

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster May 12, 2020

Hello,
 
Thank you for contacting us.
 
You are right about the fact that the report filters are not included when exporting charts. Even so, it is possible to achieve the desired result adding the header containing filters to the page.
 
It is achievable by using the header parameter of the exportTo API call. Filters applied to the chosen hierarchy can be found using the getFilter method. The list of all hierarchies can be retrieved using the getAllHierarchies API call.
 
Such methods may be helpful while implementing the described functionality. Also, it allows adding detailed information about applied filters.
 
You are welcome to learn more about the mentioned methods from our documentation:

 
We would like to kindly notice that the described approach may pose some problems. For example, the part with filters will be placed on each page of the exported PDF file.
However, it is best we can propose for now.
 
Finally, we would like to kindly notice that the showFilters parameter of the exportTo API call does not affect export to PDF. It defines whether all filters will be included when exporting to Excel. You are welcome to learn more about the method and its parameters from our documentation.
 
When exporting pivot table to PDF report filters are included in the exported file by default without the need to set the showFilters parameter to true.
 
We hope it helps.
Do not hesitate to contact us in case additional questions occur.
 
Best regards,
Illia

Public
Seekme May 13, 2020

Thanks for your answer, I managed to include filters in all of my PDF export including chart.
However, since the showFilters param does not affect PDF export, I didn’t manage to remove the initial array showing filters by default, I don’t need it anymore because I have put it manually.

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster May 13, 2020

Hello,
 
Thank you for your feedback.
 
We are happy to hear you did manage to implement the desired functionality both for the grid and for charts.
 
Concerning removing report filters added to the exported file by default, we recommend using the following approach.
 
The property showReportFiltersArea defines whether the dedicated area is displayed on the grid. In case it is set to false, report filters will not be exported. However, report filters will be removed from the grid as well. Therefore, we recommend hiding the mentioned area right before the export is started and display it after the exporting is performed.
 
We recommend checking out an example demonstrating the described approach.
 
Our team would like to provide some explanation about the following code snippet taken from the example:

flexmonster.on('exportcomplete', () => {
  flexmonster.off('exportcomplete');
  flexmonster.setOptions({
    grid: {
      showReportFiltersArea: true
    }
  });
  flexmonster.refresh();
});

flexmonster.setOptions({
  grid: {
    showReportFiltersArea: false
  }
});
flexmonster.refresh();

flexmonster.exportTo("pdf", {
  header: "Custom Filters Area"
});

 
Firstly, the tracker is added to the exportcomplete event. Such an event is triggered after the exporting is fully performed. The report filters area is going to become visible again after the event is triggered. It is possible using the setOptions method.
 
Please note that the refresh method should be executed after setting new options in order to render the component.
 
Also, we want to notice that the following line of code is a mandatory part: flexmonster.off('exportcomplete');. It unsubscribes from the event allowing to affect only the desired exporting.
 
Next, the setOptions API call is used in order to hide the report filters area, and an actual exporting is performed.
 
You are welcome to learn more about methods and event used in the example:

 
We hope it works well for you.
Do not hesitate to contact us in case additional assistance is needed.
 
Best regards,
Illia

Public
Seekme May 14, 2020

Works like a charm, thanks a lot for all of this.

Please login or Register to Submit Answer