Hi,
I'm new to flexmonster so I'm sure I'm doing something silly but I can't get it to display a custom slice on page load.
Here's what I'm doing:
When I load the page, it shows the default slice and I'm not quite sure why:
var pivot = new Flexmonster({ container: "pivotContainer", componentFolder: '/flexmonster/', toolbar: true, licenseKey: "MY KEY", report: { dataSource: { dataSourceType: "json", filename: "/src/reports/dataset", }, "slice": { "rows": [{ "uniqueName": "GROUP A" }, { "uniqueName": "GROUP B" }, { "uniqueName": "GROUP C" } ], "columns": [{ "uniqueName": "[Measures]" }], "measures": [{ "uniqueName": "COL1", "aggregation": "sum" }, { "uniqueName": "COL2", "aggregation": "sum" }, { "uniqueName": "COL3", "aggregation": "sum" }, { "uniqueName": "COL4", "aggregation": "sum" }, { "uniqueName": "COL5", "aggregation": "sum" }, { "uniqueName": "COL6", "aggregation": "sum" } ] } } });
As I said, I'm sure I'm doing something silly, but there's no console errors and everything else seems to be working correctly so I'm not quite sure what - any help would be appreciated!
Thanks
Hi Paul!
Thank you for the detailed explanation.
I have to say that don't see any mistake in your description. It looks like you are doing everything correctly. I can recommend you to check if you are changing the right file in the right folder. It's my personal favorite mistake that I did many times 🙂
Regards,
Tanya
Hi Tanya,
Thanks for the confirmation, though it's a shame I haven't made a silly mistake!
I'm confident that it's the right file that's being edited as if I remove the key I get an error message. Is there anything else you think might be worth trying?
Something I didn't mention in the original post is that I'm currently using a trial key (with intent to purchase if it suits our needs), but this page suggests that it shouldn't be an issue - "The component runs with a trial key without any restrictions, with all capabilities according to the downloaded edition".
I'll see if I can get it working using the exact example in the JSFiddle and get back to you if that does/doesn't work.
Regards,
Paul
Hi again,
I've made some progress - I have a call to update the data (this is attached to a filter which is too intensive for JS processing):
pivot.updateData({ dataSourceType: "json", filename: "/src/reports/dataset?" + serialisedInputs, });
When the page loads, this is called immediately (to fetch any pre-filtered data) - I'm not sure if this is a small bug with flexmonster:
I think I can get around this, but let me know if you think that this is a bug and would like more information to help fix it (if necessary)
Regards,
Paul
Hello, Paul,
Thank you for this detailed description.
When the component in the initialization phase, using API calls may cause unexpected results. We recommend using any API calls after the reportcomplete event is fired. Using updateData
this way wouldn't interfere with the custom slice.
I hope this information would be helpful.
Regards,
Tanya