Need a special offer?Find out if your project fits.
+

BUG: null report when calling `getReport()` after `reportchange` event

Answered
eze@wejugo.com asked on July 16, 2020

This only happens when the report has a dataSource type of "api".
If for example I add the following event handler:

pivot.on('reportchange', ($event) => {
   console.log(pivot.getReport());
});

After certain actions, for example:

  • adding a new field to the report
  • filtering one of the fields

The Pivot.getReport function returns a null report in the event handler.
After other actions like:

  • Sorting
  • Altering options
  • Switching to charts
  • Etc.

The function returns a report as expected.
 
This isn't the same when the report is a CSV for example, in which case everything works as expected.
This is tested on the latest (2.8.11) version.
 
 

12 answers

Public
Vera Didenko Vera Didenko Flexmonster July 16, 2020

Hello, 
 
Thank you for reporting this problem to us. 
 
We have managed to reproduce the issue on our end as well. 
Our team will provide the fix to this issue in the minor release version with the ETA 24th of August.
 
In the meantime, as a workaround, we kindly suggest using a combination of two events: reportchange and reportcomplete
Looking deeper, we have noticed that for the custom data source API, the reportchange event is fired before the changed report object is ready. 
The reportcomplete event can be used to get the changed report object.
Here is a JSFiddle example for illustration: http://jsfiddle.net/flexmonster/qdytz2f5/
 
 
Please let us know if this would work for you. 
Looking forward to your response.
 
Kind regards, 
Vera

Public
eze@wejugo.com July 20, 2020

Ok, thank you for that insight, using reportcomplete in combination works reasonably well as a workaround.

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster August 26, 2020

Hi!
 
We are happy to let you know that the issue with getReport() returning null after the reportchange event was fixed.
 
This is included in the 2.8.14 version of Flexmonster: https://www.flexmonster.com/release-notes/
 
You are welcome to update the component. Here is our updating to the latest version tutorial for guidance: https://www.flexmonster.com/doc/updating-to-the-latest-version/ 
 
Please let us know if everything works fine for you.
 
Best regards,
Mykhailo

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster September 2, 2020

Hi!
 
Hope you're doing well.
 
We were wondering if you've received our previous heads-up regarding the latest update. Have you had a chance to test this on your side?
 
We would be happy to hear your feedback.
 
Regards,
Mykhailo

Public
eze@wejugo.com September 4, 2020

Hello there Mykhailo,
Thanks for your message. We have received your update and have now tested the new version of the component. 
I can confirm that it is indeed working as expected now 🙂

I wanted to report a little css/rendering bug that I noticed in the last version, when using the fields menu on the right, see here: https://jsfiddle.net/ezk84/r08dkf6b/
Notice that the buttons to close the bar, as well as to add calculated measures now overflow the container and aren't completely visible. 
 
Regards,
Ezequiel

Public
Milena Pechura Milena Pechura Flexmonster September 4, 2020

Hello!
 
Thank you for reporting the issue and providing detailed info about it.
 
We have managed to reproduce the reported behavior on our side - the fix for the issue is going to be provided with a minor release ETA Sep 7th.
 
Please let us know if any other questions arise.
 
Best regards,
Milena

Public
Milena Pechura Milena Pechura Flexmonster September 8, 2020

Hello,
 
We are glad to announce that the issue with buttons’ icon alignment (CSS) for fieldListPosition: 'right' was fixed.
 
This is available in the 2.8.15 version of Flexmonster: https://www.flexmonster.com/release-notes/.
You are welcome to update the component.

Here is our updating to the latest version guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/.
 
Please contact us in case any questions arise.
 
Best regards,
Milena

Public
eze@wejugo.com September 9, 2020

Great, that works as expected. Thank you!

Public
Nilesh Wagle December 15, 2020

Hello,
I am running into the same problem that getReport() returns a null in the reportchange or update event handler. We are currently on version 2.8.7 and are at the end of our release cycle so upgrading to a new version is difficult. The reportcomplete is not fired if I change any of the column filters or row filters. It is only fired when I drag or remove a measure or a dimension from the fields list. Our data source is an OLAP cube. Can you please suggest a work around?
Thanks.
Nilesh

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster December 16, 2020

Hello, Nilesh,
 
Thank you for reaching out to us.
 
We want to confirm that the reportcomplete event is not triggered after sorting and filtering. Therefore, we recommend using the reportchange event instead.
However, until version 2.8.14, the getReport method may return null after the reportchange event as mentioned in your question.
We are currently not ready to provide you with a workaround except the one mentioned earlier in this thread (using reportcomplete event, which is not an option for you).
 
Therefore, we highly recommend considering updating to the latest version of the component.
You are welcome to see our updating to the latest version guide. It consists of steps leading to the smooth update of the component.
 
Please let us know if it works for your case.
Our team is looking forward to hearing from you.
 
Best regards,
Illia

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster December 28, 2020

Hello, Nilesh,
 
We are wondering whether our suggestion was helpful for you.
 
Our team is looking forward to hearing your feedback.
 
Best regards,
Illia

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster January 11, 2021

Hello, Nilesh,
 
We are reaching out to ask if our recent suggestion helped.
 
Please contact us if further questions arise.
 
Kind regards,
Illia

Please login or Register to Submit Answer