Exporting to Excel or PDF the hidden columns in a report
We are working with reports that have a big amount of columns (up to 70). These reports are available to the final users so they can run them to retrieve the data they are interested in.
We decided that only a small set of this columns can be shown in the UI (max 9). However, the users need to have access to all the columns when exporting the report to Excel or PDF. Several OOTB reporting features are needed, so the decision is to use the OOTB reports landing page.
In order to create the reports, a Report Definition is created with all the columns, but all of them are hidden except for a few of them that will be shown in the UI. When the Export to Excel (or PDF) action is triggered, the OOTB behavior of Pega is to export only the visible columns. Therefore, we cannot fulfill this requirement using the OOTB functionality.
After doing some investigation, we came up with a solution: modifying the Final rule "pzRDExportWrapper" and looping over each embedded page in "TmpExportResultsPage.pyReportDefinition.pyUI.pyBody.pyUIFields" and setting the ".pyHide" property to false. By doing this, every field is set to visible before exporting, so the resulting documents contain all the columns in the report.
As this implies modifying a Final rule, we would like to know if there is another way to address this problem.
(Our Pega version is 7.2.0)
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
They need to view all the columns but we decided that we will not show more than 9 as the report won't be usable and won't look good in the UI. When exporting to an Excel they need to have all the columns as the master data is stored in Pega and they need to have access to them. Right now Pega is the only tool that is used to report on the data, so it's the only way the users have to access it.