Links may not function; however, this content may be relevant to outdated versions of the product.
How to add links that execute reports to a portal gadget
Summary
Developers often want to create custom reports and add those reports as new links to gadgets on their user portal.
This procedure describes how to add a report and link to an existing report gadget.
Approach
Before you begin, create and test the summary view and list view rules for the reports you want to add.
Steps
- Use the Advanced Find tool or the Rules Inspector to locate the gadget you want to update. (Most gadgets are HTML rules (Rule-Obj-HTML rule type) with an Applies To key part of Data-Gadget.)
- Copy the HTML rule defining the gadget into an application RuleSet., to override the current gadget.
- Update your copy. On the HTML tab, add a call to the built-in JavaScript function showList() for list view rules or showSummary() for summary view rules, following the examples below.
- Save the updated HTML rule.
- Test.
Function Parameters
The showList() function calls the standard activity Rule-Obj-ListView.ShowView. This function has four required parameters that correspond to parameters of the activity.
oClass
— text parameter containing the Applies To key part of the list view rulesPurpose
— text parameter containing the Purpose key part of the list view rule. (The system assumes a third key part of "ALL")bHeader
— Boolean parameter, set to true to show the report header or false to hide the report headersAction
— corresponds to the pyAction activity parameter. In most cases, set to "Refresh
".
Similarly, the showSummary() function calls the standard activity Rule-Obj-Summary.ShowView or Rule-Obj-SummaryViewShowViewGraph, as appropriate. This function has five parameters:
oClass
— text parameter containing the Applies To key part of the summary view rulesPurpose
— text parameter containing the Purpose key part of the summary view rule. (The system assumes a third key part of "ALL")bHeader
— Boolean parameter, set to true to show the report header or false to hide the report headersAction
— corresponds to the pyAction parameter of the activityIn most cases, set to "Refresh
".bEmbeddedChart
— Boolean parameter, set to true to display an interactive chart. (The summary view rule must contain a chart definition.)
Sample HTML code to display a summary view report
</td>
<!--6--> <td align="left" valign="top">
<ul>
<li><a href="/Javascript:showSummary(
'PegaCA-Work-QualityReview',
'CAQualityReviewsInProgress',
true,
'Refresh',
false)">
Quality Reviews In Progress By Work Type</a>
</ul>
</td>
Sample HTML code to display an interactive chart
</td>
<!--3--> <td align="left" valign="top">
<ul>
<li><a href="/Javascript:showSummary(
PegaCA-Work-QualityReview',
CAQualityReviewSummaryByRating'
true,
'Refresh',
true )">Quality Review Summary By Overall Rating</a> <img src="https://docs-previous.pega.com/images/graph_bar.gif" alt="Graph" title="Graph">
</ul>
</td>