Question


Last activity: 4 Oct 2018 11:08 EDT
Highlight the Row in Report Definition conditionally
We have got a requirement where a row in a report definition needs to be highlighted with yellow color if specific condition is true. The report definition is embeded in a repeating grid.
I understand this can be easily achieved by List view via including CSS in Row Format option, but I am unable to find such option in Report Definition.
Is there anyway to achieve this in Report Definition?
For time being ,written a control as mentioned below.
To have the font color for whole row ,control has been configured for all columns of report definition.
<%
String status = tools.getActive().getParentPage().getString("pyStatusWork");
if (status.startsWith("Resolved-") )
%>
<font color="red"> <p:r n="$this-value" /> </font>
Would it be feasible solution for performance reports?
**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.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution


Pegasystems Inc.
IN
- getParentPage() will point to pyWorkPage in your case so condition will not be satisfied.
- I was always under assumption (from title also) that you are trying to highlight entire row in grid
- If it is only about one column, I would suggest creating a section for that column and hide/show layout conditionally with proper CSS and avoid suggested work around
- You can check OOTB pxUrgencyAssign section for sample where we highlight color of Urgency column in grid conditionally if urgency is low, medium or high.
- For report definitions you can use custom section to display rows and they can be again conditionally displayed (layouts)
- You can find this setting under Report Viewer tab "Display rows using custom section"
Let us know in case of any other clarifications and please prefer to use OOTB ways mentioned above of using instead of inline style.
That solution will be efficient when you want to highlight entire row


Pegasystems Inc.
US
Hi Brahmeswara,
Full disclosure, this is not something I've tried myself, but what if you tried doing the customization on the repeat grid itself instead of in the report definition?
In taking a quick look, I found that the repeat grid layout let's you define an inline style on the row. In addition, you can define your own custom table style and reference it in the grid's property panel: Presentation tab > Style > Other.
Thanks.
B.


Yes Brendan,we can apply inline style on the row (for all rows), but how to apply styles on specific rows by conditionally?.


Pegasystems Inc.
US
I was thinking that you could perhaps leverage the inline style to insert the conditional CSS similar to what you were doing for list views. But on second thought that field most likely doesn't offer that level of granularity.
Would it be possible to configure your row layouts within a section with conditionalized layouts to display the data in one style or the other?
It's very possible that your solution of using the custom control to conditionally display the data the way you want is the best solution. But definitely would encourage others to chime in with alternate suggestions.
Thanks.
B.


Pegasystems Inc.
US
I would also suggest taking a look at the Skin rule form and see if there's something you can leverage using some combination of the configuration options.
I see that you can define styles for banding and total rows. As well as selected rows and hovering. In most cases these options provide the ability to define "additional styles". Nothing seems to be specific to conditional behavior, but at the same time, it looks like you can pretty much enter your own CSS styles. So maybe there is the potential to define these additional styles with programatic conditions, and then you can reference the skin from the grid layout property panel.


Pegasystems Inc.
US
*Also* (in what you can certainly call me out as trying to "troubleshoot this backwards"), going back to your original question: Is there anything in the Report Definition that let's you customize the look of the rows... I suggest taking a look at the "Display rows using custom section" option on the Report Viewer tab.
I think this might be what you are really looking for. It's actually an improvement over the list view functionality in that you can manage the conditional layouts of your row display leveraging an auto-generated section rule. It will probably require some playing around with, but I suggest giving it a shot.
Here's a basic overview of the option (and its limitations) as documented in the Help:
*Also* (in what you can certainly call me out as trying to "troubleshoot this backwards"), going back to your original question: Is there anything in the Report Definition that let's you customize the look of the rows... I suggest taking a look at the "Display rows using custom section" option on the Report Viewer tab.
I think this might be what you are really looking for. It's actually an improvement over the list view functionality in that you can manage the conditional layouts of your row display leveraging an auto-generated section rule. It will probably require some playing around with, but I suggest giving it a shot.
Here's a basic overview of the option (and its limitations) as documented in the Help:
-
Display rows using custom section - Optional. Available only for list reports. Select to replace the default display for each row of a report with a custom section. A field opens where you can select the section. Select the edit icon to create a new custom section.
Sections used for this purpose can have simple controls such as text fields, but cannot use complex controls such as grids or trees.
Test any custom sections you that use for displaying rows. You might get unexpected results as the report definition tries to populate a section that does not account for all the properties it displays.
Nested sections might not render properly when used as custom sections. When a window is resized, the width of the custom section does not automatically resize. Design the custom section to fit into the smallest display size that is possible.


Pegasystems Inc.
US
Hi Brahmeswara,
What release are you using?
This Pega 7.1.x PDN Article indicates that color conditionals are supported for Charts, but this capability is not mentioned for Report Definitions.
https://community.pega.com/node/45251
(https://pdn.pega.com/reporting/fine-tuning-reports-in-pega-7)
Srikanth Challapilla might be able to answer your question.
-Mary


Pegasystems
IN
we don't have the option to do the row coloring OOTB. But the approach you follow using the control to conditionally color the rows is what everyone is following for now.


Nordea
SE
Hi,
Correct me if I am wrong but the control mentioned above will only apply to a specifc column rather than entire row. The requirement here is to highlight the entire row rather than highlighting columns.@.


As i mentioned earlier as to highlight the entire row ,control has to be configured for all columns of report definition.


Nordea
SE
Control can be configured for all columns but will it give you the same look what you used to get in List view? I think It will only highlight those fields but not full row. My requirement is to highlight full row.


Pegasystems Inc.
IN
I would actually prefer Inline style for rows instead of controls for two reasons
- They can be easily applied to each column (can be applied to entire row)
- And once product supports this feature they can be easily removed


Yes ..we can go for inline styles to highlight full row ..but how it can be done conditionally ?


Pegasystems Inc.
IN
Can you try below code in inline style at grid row level and let us know if this helps.
<%=
tools.getActive().getParentPage().getString("pyStatusWork").startsWith("Resolved-") ? "background-color: grey;" : ""
%>


Pegasystems Inc.
IN
Could you also paste screenshot if this works
Meanwhile I will raise a enhancement request for this feature in Grids, so that workarounds can be avoided in future.
Thanks


Highlighted row feature is more required in Report definitions rather than in Grid,since same feature is available in list view.
Business is looking for this feature in reports which are part of report browser.
It would be great if you raise a enhancement request for this feature in grids & Report Definitions.


Pegasystems Inc.
IN
Sure


Above snippet of code is not helped.


Pegasystems Inc.
IN
Could you paste your configuration screenshot. I just tried this code in my grid and it worked.


Added below snippet of code to the second col of gird .
Requirement would be show BG of the field as "red" color format if product id starts with "DX001".
<%=tools.getActive().getParentPage().getString("ProductID").startsWith("DX001") ? "background-color: red;" : "" %>
1) Grid Layout Configuration.
2) Changes are not affected as Product Name column is not highlighted for DX001.
3) clipboard page for above list .
Updated: 31 Aug 2015 14:21 EDT


Pegasystems Inc.
IN
Could you change Code to below snippet (according to your list structure) and let me know if it helps.
<%=tools.getActive().getPageValue().getString("ProductID").startsWith("DX001") ? "background-color: red;" : "" %>


Thanks a lot pankaj ,
it's working fine, but i what to understand that what is wrong with using getParentPage()?
Is it possible to make similar one for report definitions.. Here we must go for control to have this format.
Accepted Solution


Pegasystems Inc.
IN
- getParentPage() will point to pyWorkPage in your case so condition will not be satisfied.
- I was always under assumption (from title also) that you are trying to highlight entire row in grid
- If it is only about one column, I would suggest creating a section for that column and hide/show layout conditionally with proper CSS and avoid suggested work around
- You can check OOTB pxUrgencyAssign section for sample where we highlight color of Urgency column in grid conditionally if urgency is low, medium or high.
- For report definitions you can use custom section to display rows and they can be again conditionally displayed (layouts)
- You can find this setting under Report Viewer tab "Display rows using custom section"
Let us know in case of any other clarifications and please prefer to use OOTB ways mentioned above of using instead of inline style.
That solution will be efficient when you want to highlight entire row


Pegasystems Inc.
JP
A couple of months ago I raised an enhancement request for conditionally apply format for a control following another discussion here, How to specify multiple formats for a control conditionally


Pegasystems Inc.
IN
Awesome.. Thanks Chunzhi


UHG
IN
HI Pankaj
I have same kind of scenario , but small change here condition based on pxcreatedatetime property the work object id's are showing in different color in section itself for that what should I do .
please help me for this above scenario .
Thanks for advance


Infosys
IN
Hi,
Does this feature is get updated in pega 7.2.2 and if there then how to use it?.
Thanks ,
Mahesh


Agora Group Pvt. Ltd
IN
Hi Pankaj,
I have a similar kind of requirement to display grid row in read only based on some condition.
Note: I have configured onclick event on the grid rows, so for rows other than read only I want to fire this event. Will this be possible? Grid source is RD.


Pegasystems Inc.
IN
Do we have story or enhancement request in place for this ? I can raise one if needed .
Updated: 2 Sep 2015 8:46 EDT


Nordea
SE
Hi,
Please refer to the screenshot below. Could you please suggest how would i use above mentioned code snippet for my requirement. Currently I am using below HTML fragment to highlight specific field (here it is Flight No)
But my requirement is to highlight the row in below format. Below report was built in list view---


Nordea
SE
I have finally figured it out how to use above code snippet in my case.
Refer Property in section via jsp. for e.g.:--
<pega:reference name = '.pxPages(F).ATCCallSign' format = 'pxTextInput'/>
Then put below inline style
<%=tools.getProperty(".deIcingRequestStatus").getStringValue().startsWith("Requested") ? "background-color: yellow;" : "" %>
It's working fine now.
Thank you so much for your help!!!


Global Payments
US
We have a similar requirement now. Any update feature from Pega to highlight the row in a report definition conditionally in the latest version?
Thanks


Techmahindra
IN
Hello Thiyagrules,
The main reason for report definition is for reporting activities such a filter, export to excel pdf etc. Within the product in the latest version too nothing is embedded. As mentioned on the top there are many ways to use custom css to achieve the same as per business requirement.
Regards,
Shanthini Charles