Connonymous Posted September 5, 2023 Report Share Posted September 5, 2023 Is there a way to specify which columns will be included in the download of a tabular report? For context, I have a tabular report and I wanted to conditionally hide columns that were not being used depending on the filtering of the data. I did this by creating calculated fields that would specify if a column was being used, and hide it if it was not being used, sort of like what the article below walks through. That works well for viewing the table, but when I make the table downloadable all the helper columns are also downloaded. So, is there a way to specify which columns I would like to be included in the download? Or is there a better way to conditionally hide columns that does not involve creating a bunch (in my case, 30) of calculated fields? Quote Link to comment Share on other sites More sharing options...
DrSimi Posted September 5, 2023 Report Share Posted September 5, 2023 Hi, The alternative is hiding the columns conditionally using pure JavaScript. See the last part of this comment for sample code: Keep in mind, all columns will be visible in the data downloaded regardless of the code to hide columns. Hope this helps. Quote Link to comment Share on other sites More sharing options...
Connonymous Posted September 8, 2023 Author Report Share Posted September 8, 2023 Hi @DrSimi, Thank you for sending this over. Looking at that post, it looks like that would have the same issues I am running into currently, it would just use JavaScript instead of CSS. If calculated fields are needed as helper cells, then we are hiding them, then they would still be present when downloading the table. Would there be any way to hide these columns without the helper calculated fields, or to have them not be included in the data download? Any help or ideas would be greatly appreciated! Quote Link to comment Share on other sites More sharing options...
DrSimi Posted September 11, 2023 Report Share Posted September 11, 2023 hi @Connonymous, The only way I can think of, is to not use Calculated Fields for the "helper cells" at all, if your use case allows it. This means you will need to code all the conditions in your current Calculated Fields in JavaScript, then hide the columns with that too. This method has limitations in that you cannot perform certain calculations that rely on the database, but may work for most cases. In any case, I don't know of any method to hide columns in the download, it always displays everything as configured in the DP settings. Quote Link to comment Share on other sites More sharing options...
Connonymous Posted September 13, 2023 Author Report Share Posted September 13, 2023 @DrSimi Okay, thank you! I am no JavaScript expert, but I will give it a try and see if it is anything I can figure out. I appreciate you taking the time to help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.