PxPlus User Forum

Main Board => Discussions => Nomads => Topic started by: James Zukowski on July 31, 2020, 12:47:41 PM

Title: Hiding Query Columns
Post by: James Zukowski on July 31, 2020, 12:47:41 PM
Is there a way to programmatically Hide/Show specific Query columns? Rather than have 2 or more separate queries, we would like the program to be able to identify any columns different from standard.
Thanks!
Title: Re: Hiding Query Columns
Post by: Jane Raymond on July 31, 2020, 01:36:08 PM
If you have the PxPlus security system set up, then you can assign security to specific fields in the data Dictionary. When the query runs, the security setting for each field is checked and the field is displayed or not depending on that setting.


If there is no security set up, then there is really no way to change the query column settings programmatically prior to display. You could conceivably create a formula column that displays the value (or not) depending on a TBL() condition, e.g. TBL(%showcol=1,"",myfield$).


Another thought would be to set the column as hidden in the definition, which means that the initial display of the query will hide the column. The end user can then use the run-time Hide/Show/Reorder Columns feature to show the column. For those users who should not see the column, you can suppress the Hide/Show/Reorder Columns feature by adding "H" to %nomads'Query_Suppress_Popup$ on their system.
Title: Re: Hiding Query Columns
Post by: James Zukowski on July 31, 2020, 03:56:00 PM
In this case, it would be based on the program being run, not the person running the program. From what it looks like, it will be easier to simply copy the query and add/remove columns we choose.
Thank you!