Get Free Trial

Is there a way to use personalized slice in getData() for Database?

Javier Sanz Lopez asked on April 28, 2020

Good afternoon.
In my app I was using the third party chart functionality to create dynamic charts based on the information present in the table very succesfully in the beginning, as I was using a JSON database, so I would load a stored slice and retrieve the exact data I needed.
Later on, I had to move to a postgres DB approach using the Flexmonster Data Server. I could load my data perfectly on the server and display it on the table.
However, it is limiting my chart options a lot, as I cannot control the slice of data that I want to display. I could zig-zag through it using the whole amount of data present on the table (using getData() with no slice) but I find problems like the following ones:

  • If I have nested information, like the one shown in the attached image, and I want to create a chart like the one present there too (which shows the distribution inside GWP), as soon as I collapse GWP I lose the data for that chart (as the table doesn’t load it cause it isn’t shown).
  • If I select an operation for a certain value (e.g sum of value in the picture) then my charts would use the sum for that value, even if i would like to use the average, min…

The question is: Is there any way to indicate the slice to recover just the data I need for the chart in the order and with the units that I need for the chart using Database as you can do with the JSON?
Thanks for everything and kind regards.


6 answers

Illia Yatsyshyn Illia Yatsyshyn Flexmonster April 29, 2020

Hello, Javier,
Thank you for reaching out to us.
Our team would like to kindly explain that the different slice for charts can not be specified in case Flexmonster Data Server is used as a data source. It is due to the fact that the data set is not wholly stored. Instead, only its part required for the configured display is loaded.
As a workaround, we recommend creating an additional instance of Flexmonster that would use built-in charts and an appropriately configured report.
In case the integration with third-party charting libraries is required, it is possible to use the same workaround as mentioned above, but use the desired library instead of built-in charts.
We hope it helps.
You are welcome to contact us in case further questions occur.
Best regards,

Javier Sanz Lopez April 29, 2020

Good afternoon Illia.
Thanks for the information and the workaround, I will discuss it with my superiors and try it and let you know if i need help when deploying it.
Best regards.

Javier Sanz Lopez May 5, 2020

Good morning.
Would you have an example on how to deal with multiple instances of Flexmonster in Angular? Because I tried to use ViewChildren but it is difficult to select which one do you want to use when there is no ID or something to select which one is the correct one.
Thanks for everything!

Illia Yatsyshyn Illia Yatsyshyn Flexmonster May 5, 2020

Thank you for reaching out to us.
Our team would like to kindly explain that the unique identifier of the instance can be assigned in the following way:

<fm-pivot #pivot1 ...></fm-pivot>
<fm-pivot #pivot2 ...></fm-pivot>

In such a case, instances can be gotten using the ViewChildren in the following way:

@ViewChild('pivot1') pivot1: FlexmonsterPivot;
@ViewChild('pivot2') pivot2: FlexmonsterPivot;

You are welcome to find out an example demonstrating the creation of multiple instances on our GitHub.
It is represented as tabs.component included in the repository (
We hope it helps.
Do not hesitate to contact us in case any additional questions occur.
Best regards

Javier Sanz Lopez May 6, 2020

Thank you Illia!
I will check it out the example in Github. I actually did it the same way myself which works while they set up a limit of flexmonster tables they would like to have, as you know that ViewChild cannot be loaded dynamically, they all have to exist when the component is created.
I guess if they want to establish an unlimited amount of tables (which wouldn’t be a good idea) I would have to use the Javascript approach in this case.
Also, took your advice with the charts and works as a charm. So thank you so much!
Best regards.

Illia Yatsyshyn Illia Yatsyshyn Flexmonster May 6, 2020

Hello, Javi,
Thank you for your feedback.
We are happy to hear the workaround works well for you.
Please contact us in case additional assistance is needed in the future.
Kind regards,

Please login or Register to Submit Answer