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

Track pivot fields changes

Answered
Alessio asked on August 8, 2018

Hi,
I am trying to track changes when user select measures or dimensions in the field list. I have created a handler on reportChange event but when I get the report with getReport() method measures, columns and rows in slice not reflects user selection.
Any idea? 
 
I also facing an error on JS loading:
flexmonster.js:9 Uncaught TypeError: Cannot read property 'wI' of null
but it does not seem blocking.
 Any suggestions?
 
Thanks,
 
Alessio

4 answers

Public
Tanya Gryshko Tanya Gryshko Flexmonster August 8, 2018

Hello, Alessio,
Thank you for writing to us!
For such cases, we recommend using update event. It should retrieve the information correctly. Please let us know if it works for you.
As about the error on loading, we weren't able to reproduce it on our side. Could you please share your loading configurations? It may help us to detect the issue.
Waiting for your reply.
Regards,
Tanya

Public
Alessio August 9, 2018

Thank you Tanya,
I have an asp.net website. In a folder scripts I had put flexmonster folder, then in a master page, there are flexmonster.css and flexmonster.js references.
When I load the pivot I have something like that:
var pivotSettings = {
container: "pivot-container-"+that.id,
toolbar: true,
componentFolder: that.options.componentFolder,
licenseKey: that.options.licenseKey,
width: "100%",
height: "100%"
};
that.pivot = new Flexmonster(pivotSettings);
where component folder point to scritps/flexmonster folder.
After initialization, I set the report with that.pivot.setReport(settings.report);
where settings.report is loaded at runtime, ie:
"report": {
"slice": {
"reportFilters": [{
"uniqueName": "OrderDate.Month",
"filter": {
"members": ["orderdate.month.[september]"]
}
}],
"rows": [{
"uniqueName": "ProductKey",
"caption": "ProductKey",
},
{
"uniqueName": "PromotionKey",
"caption": "PromotionKey"
}],
"columns": [{
"uniqueName": "CurrencyKey",
"caption": "CurrencyKey"
}],
"measures": [{
"uniqueName": "UnitPrice",
"aggregation": "sum",
"active": false,
"format": "3553eeff",
"caption": "UnitPrice"
}],
"expands": {
"rows": [{
"tuple": ["productkey.[336]"]
},
{
"tuple": ["productkey.[313]"]
},
{
"tuple": ["productkey.[310]"]
},
{
"tuple": ["productkey.[345]"]
}]
},
"memberProperties": [{
"levelName": "insert"
},
{
"levelName": "move"
}]
},
"options": {
"grid": {
"showHeaders": false,
"drillthroughMaxRows": 0
},
"configuratorButton": false,
"showDefaultSlice": false,
"showEmptyData": false,
"selectEmptyCells": false
},
"conditions": [{
"formula": "#value < 4000",
"format": {
"backgroundColor": "#FFFFFF",
"color": "#8BC34A",
"fontFamily": "Arial",
"fontSize": "12px"
}
}],
"formats": [{
"name": "3553eeff",
"thousandsSeparator": "",
"decimalSeparator": ".",
"currencySymbol": "$",
"currencySymbolAlign": "left",
"nullValue": "EMPTY",
"textAlign": "right",
"isPercent": false
}],
"tableSizes": {
"columns": [{
"idx": 0,
"width": 167
}],
"rows": []
}
}
 
 
 

Public
Iryna Kulchytska Iryna Kulchytska Flexmonster August 10, 2018

Hi Alessio,
 
Thank you for sharing the details with us.
 
We have prepared a JSFiddle sample https://jsfiddle.net/flexmonster/6z0y7514/ that illustrates the flow you described.
It is based on the latest component's version 2.6.0. We used a very similar report to the one you provided above and added trackChanges() function on reportchange event. It seems that everything works as expected. For example, when you select a new measure in Field List and click Apply button, reportchange event is triggered and the proper slice is returned in getReport() method called for the pivot instance.
 
Also, we cannot reproduce the error you mentioned in the first message of this thread. Could you please check the version of the component you use? To do this please click on the grid and press Ctrl+Alt+i.
 
Please let us know if the JSFiddle sample is useful. Feel free to modify it the way you want if you need to provide us with any additional info about your case and the error.
 
Looking forward to your feedback.
 
Kind regards,
Iryna

Public
Alessio August 10, 2018

Ok, 
thanks! 

Please login or Register to Submit Answer