Default fields depending on view

Answered
Gennady Gandelman asked on October 25, 2023

Hey Guys,
We present reports in pivot table view by default but our users can switch to flat view. We'd like to be able to control the fields presented based on the view chosen. For example, we don't want calculated fields in flat view since it lists data at the most detailed level. Do you have a recommendation for how to handle this?
Thank you!

3 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster October 25, 2023

Hello Gennady,

Thank you for reaching out to us.

We recommend using the reportchange event to check if the view type changes and then setting a new slice using the runQuery API call. You are welcome to check the following JSFiddle for illustration: https://jsfiddle.net/flexmonster/L9w1phva/. Feel free to customize it for your needs.

Please let us know if it works for you. Looking forward to hearing from you.

Kind regards,
Nadia

Public
Gennady Gandelman October 25, 2023

Nadia, appreciate the response. We'll consider the approach you suggested and let you know if further questions come up. Thank you

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster October 26, 2023

Hello Gennady, 

Thank you for the feedback.

Do not hesitate to contact us in case any questions arise.

Kind regards,
Nadia

Please login or Register to Submit Answer