Force measure formatting refresh

Answered
Daniel Rutledge asked on June 28, 2019

Hello, our Pivot table component currently uses the updateData method to pull in different scopes of data, one of which is a reporting currency, which will update the currency field values, as well as supply a different currency format corresponding to the selection. The data returns properly, but the measure formats need to be reset as well. What is the best sequence of API calls to accomplish this?

3 answers

Public
Tanya Gryshko Flexmonster June 28, 2019

Hello, Daniel,

Thank you for writing to us.

The API calls setFormat() and getFormat() can be used to manipulate number formatting at runtime. For more details about number formatting, you can refer to this tutorial: https://www.flexmonster.com/doc/number-formatting/.

Please inform us in case of further questions.

Regards,
Tanya

Public
Daniel Rutledge June 28, 2019

Hi Tanya, that would work if I’m using the setFormat function explicitly, but the backend data call also returns a Flexmonster report object with the formats populated, in addition to new JSON data. The updateData call refreshes the data, but returned formats in the report object aren’t getting applied. I tried applying the refresh function after updateData, but the displayed formats were not affected.
Note that if the alternate currency is visited directly, the formats are displayed correctly on the first pass, so the formatting logic and fields are working properly.

Public
Vera Didenko Flexmonster July 1, 2019

Hello, Daniel,
 
Thank you for your reply.
 
We would like to point out that the updateData() API call only updates the dataSource. It is important to keep in mind that everything else in the report, including formatting, will not be changed. 
 
If you would like to set formatting along with the data update, we kindly advise using the setReport() API call instead of updateData.
 
Please let us know if this works for you.
 
Best Regards,
Vera

Please login or Register to Submit Answer