Absent Member.
Absent Member.
8193 views

How can I change the background color for listing report rows based on field value

I have a binary / trinary field that I would like to use to determine the background color for rows in a listing report. Does anyone know how I can achieve this? If the same solution can work for the editable grid feature as well, that would be great. I know there were threads about this in the old community, but searching for them hasn't turned up any useful information and many of the replies appear to have been lost. Any help would be greatly appreciated. Thanks!

Jason
Tags (1)
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

Re: How can I change the background color for listing report rows based on field value

Your best bet right now is to create a custom report template with the the highlighting logic built in. Essentially you'll have JavaScript that will look for certain field values then apply a style to the containing row.

This feature won't work for the editable grid though, the current version of that is completely independent from an HTML/JavaScript view of the data.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: How can I change the background color for listing report rows based on field value

I'd be interested in this as well.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: How can I change the background color for listing report rows based on field value

Hi,

here is an example how to "blink" rows matching some text.
- make a copy of urlrpt.htm, i.e. urlrpt-blink.htm
- put this as JavaScript into the template

function highlight() {

var highlighter = setInterval( function() {
jQuerySBM('#ReportOutput tr td[class="listField"] span').filter( function() { return jQuerySBM(this).text() === "YOURVALUETOMATCH HERE" })
.parents('.listrow1, .listrow2')
.children(':nth-child(1)')
.toggleClass("redbox")}
, 500);

}


- put some CSS into the template, to format how the highlighting is done



- call your function as last statement in the init() function (just put a highlight() as last line). This ensures the document has been loaded and the table is formatted already.

- "YOURVALUETOMATCH HERE" is the value to match
- make sure your list reports uses the new template

Cheers
Brian
Highlighted
Absent Member.
Absent Member.

Re: How can I change the background color for listing report rows based on field value

Is there a way to make the background color change only for items with a modified date that is within the past 7 days?
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.