Support Article
Exported report contains pyWorkUrgencyDraggable Control code
SA-21143
Summary
Performing an 'Export To Excel' from a Report Definition that uses the control pyWorkUrgencyDraggable to format a column results in the content, which is actual code of the control appears in the Excel sheet unexpectedly.

Error Messages
Not applicable.
Steps to Reproduce
- Create a Report Definition on the class Assign-Worklist or re-use the Assign-Worklist pyWorkList instance.
- Set the .pxUrgencyAssign as a first column source.
- In the options set the column format to use the pyWorkUrgencyDraggable control.
- Save the report then launch it.
- Click OK, the clock is displayed in the browser column for Urgency.
- Click Excel export link and open the generated Excel file.
- Click Not Ok, rule content is included in the Excel file column for Urgency.
Root Cause
This issue was determined to be a product enhancement request as the Control pyWorkUrgencyDraggable has never been created with Export to Excel functionality included in it.
Resolution
Follow the steps below to create a customer specific implementation of the Control pyWorkUrgencyDraggable to amend the behavior as required:
1) Perform a ‘Save As’ of the Control pyWorkUrgencyDraggable into a custom application ruleset version.
Note: this is an available rule that is expected may be customized and updated in customer applications.
2) Add the following additional ‘when’ statement to the Control HTML block beneath the <pega:choose> tag to amend the behavior of the control when an export to Excel is initiated so that a blank value is provided.
<pega:choose>
<pega:when test="param.exportmode == 'excel'"></pega:when>
<pega:when test="pxRequestor.pyPegaDesignMode != 'true'">
The screenshot below shows the code in place within the rule instance itself for reference.

Within the custom implementation user can determine how best to present the data within the Excel export in line with the user requirement, for example:
1) Insert the value of the property to the cell:
<pega:when test="param.exportmode == 'excel'"><%=theValue%></pega:when>
2) Leave the cell blank:
<pega:when test="param.exportmode == 'excel'"></pega:when>
3) Insert static text in the cell:
<pega:when test="param.exportmode == 'excel'">N/A</pega:when>
4) Save the updated rule.
5) Test the Export functionality.
With this updated custom Control in place there is no need to update or amend the Report Definition configuration in order to see the required behavior when the control “pyWorkUrgencyDraggable” is used and an export is conducted.
With the local-change in place, when Export to Excel is initiated, the column that uses the Control pyWorkUrgencyDraggable will not contain the source code of the control itself.
Published April 4, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.