I have a page where the current year, month, etc is populated as a javascript variable when the web page is loaded. I would like to set up filters where the web page variable is pulled in to the filter on the flexmonster grid.
Sometimes would use the current year variable to set the fiscal year or period.
Example: reportFilters: [ {uniqueName: "year", filter:{members:['year.[varyr]','year[varyr2]']}}
where varyr and varyr2 are defined as variables when the web page is loaded
It is like a template variable. Is this possible
Thanks
Paul
Hello, Paul,
Thank you for reaching out to us.
It is possible to use a variable to set the Report Filter in Flexmonster. For example:
let slice = flexmonster.getReport().slice;
slice.reportFilters = [{
"uniqueName": "Year",
"filter": {
"members": [
`Year.[${date}]`
]
}
}];
flexmonster.runQuery(slice);
You can see the example on the following JSFiddle for reference: https://jsfiddle.net/flexmonster/onmag0u8/
Please let us know if it works for you. Feel free to contact us if other questions arise.
Kind regards,
Nadia
Hello, Paul,
Hope you are doing well.
We were wondering if you had a chance to test a suggested approach.
Looking forward to hearing your feedback.
Kind regards,
Nadia
Hello, Paul,
Hope you are doing well.
Just checking in to ask if you found a suggested approach helpful.
Our team would be grateful for your feedback.
Kind regards,
Nadia