Customize the lists of properties and calculations available in the Report Editor
In Pega 7, you can customize the lists of properties and calculations that appear in the Data Explorer of the Report Editor for reports in a given class.
Application case types may have large data models with many properties. By default, the Data Explorer showsonly Best Bet properties — those most frequently used in existing reports — but even this list may be long (as in the screenshot at right) and potentially confusing to end users who are not familiar with the application’s data model and do not have access to a usable Data Dictionary.
With the procedures described in this article, developers can limit the properties and calculations shown to non-developers in the Data Explorer to shorter, customized lists which will simpler for end users to use.
- Customize the Data Explorer properties list
- Add embedded properties to the list
- Add properties from associations and joined classes
- Customize the Calculations tab
Customize the Data Explorer properties list
By default, properties appear in the Data Explorer on the Best Bets and All Matches tabs, as in the image above.
- Log in to PRPC using an account with developer permissions.
- Locate the class on which the report for which you want to customize the Data Explorer is created, or the class for which you want to create a new report with a customized Data Explorer.
- In that class create a new data transform: Right-click the class and select on New > Data Model > Data Transform. Name the data-transform pyReportEditorProperties; this name is required for the customization.
- In the data transform, in the Pages and Classes tab, include pgAvailableProperties in the class Code-Pega-List.
- On the Definition tab, in the first row, select "Update Page" in the Action column and set the target as pgAvailableProperties.
- In the nested row, set the Action to "Append and Map to" and set the target as pgAvailableProperties.pxResults.
- In the nested row below that, set the Action to "Set" and the Target to .pyClassName as "equal to" the class for the report. Your screen should look like this:
- Right-click the "Set" action (the third line in the image above) and select "Add sibling below". In the new line, set the Action as "Append and Map to" and set the Target to.pxResults.
- In the nested row below that, set the Action as "Set" and set the Target to .pyPropertyName as "equal to" any property you want to include in the list in the Data Explorer; for example, pyDeadLine. Make sure the property is in the primary class, and that it is spelled and with upper and lower case exactly as the name of the property is.
- Repeat steps 8 and 9 for each property you want to add. In this example, we're adding pyChargeTo, pyCustomer, and pyReopenCount.
- Insert as the first step a new line. Set its Action to "Remove" and its Target to pgAvailableProperties. The data transform should now look like this:
Save the data transform. When you next open a report for that class in the Report Editor, the Data Explorer shows a much shorter and more manageable list in the Available Columns tab:
]
Add embedded properties to the list
To add embedded properties to the list, modify the data transform you created in the previous section with these additional steps:
- Right-click any property you have already added and select "Add Sibling Below".
- In the new row that appears, set the Action to "Append and Map To" and the Target to .pxResults.
- In the nested row below that, set the Action to "Set" and the Target to .pyPropertyName "equal to" the top-level property in which the embedded property you want is included. In this example, it is pyWorkParty.
- Right-click the "Set" step you just created and select "Add Sibling Below".
- In the new row that appears, set the Action to "Append and Map To" and the Target to .pxResults.
- In the nested row below that, set the Action to "Set" and the Target to .pyPropertyName "equal to" the embedded property you want. In this example, it is pyPartyIdentifier.
At this point, the embedded property is a page-list property. - To change the embedded property to an indexed property, right-click the row you created in step 6 and select "Add Sibling Above".
- In the new row that appears, set the Action to "Set" and the Target to .pyBaseClass "equal to" PartyURI, as in the image below:
Save the data transform. When you next open a report for that class in the Report Editor, the display in the Available Columns tab includes the embedded property Party ID:
Add properties from associations and joined classes
If your Report Definition has associations and joined classes, you can include properties from them in the display in the Data Explorer by adding a "+ More" link. When users click the link they can expand the list.
- Right-click the last "Append and Map to" step in the data transform you created above and select "Add Sibling Above".
- In the new row that appears, set Action to "Update page" and the Target to MorePage.
- In the embedded row, set the Action to "Set" and the Target to .pyPropertyName "equal to" More, as in the image below:
- Right-click the last step and select "Add Sibling Below".
- In the row that appears, set the Action to "Append To" and the Target to "pxResults(2)" (you must enter this manually, not select it).
- In the "relation" field next to where you entered "pxResults(2)", select "an existing page". In the source column select MorePage:
Save the data transform. When you next open a report for that class in the Report Editor, the display in the Available Columns tab includes the embedded "+ More" link:
Customize the Calculations tab
The Calculations tab in the Data Explorer displays by default all the SQL functions available in all circumstances for all reports, as in the image at right. For any given report, only a minority of the SQL functions are relevant. In a process similar to that outlined above, you can customize the list of SQL functions to provide only those that are relevant to the current report.
To customize the list, follow a procedure similar to that described for customizing the properties list:
- Log in to PRPC using an account with developer permissions.
- Locate the class on which the report for which you want to customize the Data Explorer is created, or the class for which you want to create a new report with a customized Data Explorer.
- In that class, create a new data transform: Right-click the class and select New > Data Model > Data Transform. Name the data-transform pyReportEditorFunctions; this name is required for the customization.
- In the data transform, in the Pages and Classes tab, include the following pages with their classes as indicated:
- pgAliasFunctions - Code-Pega-List
- ResultsPage - Rule-Alias-Function
- On the Definition tab, in the first row, set the Action to "Update Page" and the Target to ResultsPage (the page assigned to Rule-Alias-Function above).
- In the nested row, set the Action to "Update Page" and the Target to .pyRuleName "equal to" a defined alias function you want to include in the list, such as pxLength.
- Right-click "Update Page" and select "Add Sibling Below".
- In the new row, set the Action to "Update Page" and the Target to pgAliasFunctions (the page assigned to Code-Pega-List above).
- In the nested row, set the Action to "Append to" and the Target to pxResults. In the relation field to the right of the Target, select "an existing page" and select ResultsPage as the source.
If you save the data transform at this point, it populates the list in the Calculations tab of the Data Explorer with a single alias function, which in this case is "Length". Repeat from step 5 for each function you wish to include.
The image below shows the Calculation tab list that results from deploying a data transform that adds to the list a small and relevant number of calculations: