Hi!
I use nested report with two Classic Reports, how can I use highlight based on column value for both?.
Thanks in advance!
❇️ OrclQA.Com is a question and answer forum for programmers.
❇️ Here anyone can ask questions and anyone can answer to help others.
❇️ It hardly takes a minute to sign up and it is 100% FREE.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
afzal
step -1
give class name for your report like-- emp
at report region , appearance section "CSS Classes" => emp
step -2
create a dynamic action at page load
action == execute javascript code
like--
//-- replace your conditional column with "DEPTNO", AND ALSO REPLACE TEXT =='10' WITH YOUR CONTENT
$('.emp [headers=DEPTNO]').each(function(){
console.log($(this).text());
var text=$(this).text();
if (text == '10'){
$(this).closest("tr").children().css({"background-color":"red"});
}
});
pavlos
Thanks a lot!
It works for parent region, but doesn't work for nested child region.
I would like to disable hover, background color is changed to default when mouse is over highlighted row
afzal
Hi pavlos,
are you using plugging for nested report ?
pavlos
I created nested report manually.
pavlos
Hi!
How can I compare date column with JavaScript?
I want to change row color where date is less than current date.
Vinish Kapoor
Create a dynamic action as Style type and specify the JavaScript expression for the dynamic action as following:
Here the P1_yourdate is the item with which you want to compare with the current date. Also, create an item P1_currdate and on page load assign the current date to it.
pavlos
How can I get vales into :P1_yourdate for all rows and compare them?
Vinish Kapoor
For all rows? It seems you want to compare the date in the interactive grid. Then you just need to refer the IG column (:YOURDATE) instead of the page item (P1_yourdate).
pavlos
Sorry for bad explanation, I want to compare data in the Classic Report.
afzal
step 1---
report query like--
select EMPNO,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
COMM,
DEPTNO,
to_date(to_char(sysdate,'dd-mm-yyyy'),'dd-mm-yyyy')-to_date(to_char(HIREDATE,'dd-mm-yyyy'),'dd-mm-yyyy') as dummy
from EBA_DEMO_CHART_EMP
step-2 column-name-- HIREDATE
KEEP HTML EXPRESSION LIKE -- <span data-id=#DUMMY#>#HIREDATE#</span>
step-3 make dummy column as hidden column
step-4
give class name for your report like– emp
at report region , appearance section “CSS Classes” => emp
step-5
create a dynamic action at page load
action == execute javascript code
like–
//– replace your conditional column with HIREDATE
$('.emp [headers="HIREDATE"]').each(function(index,element){
var x= element.innerHTML;
//console.log($(element).children().attr('data-id'));
var text= parseInt($(element).children().attr('data-id'));
if (text > 1){
$(this).closest("tr").children().css({"background-color":"red"});
}
});
pavlos
Thanks a lot, it works. But, I am using faceted search with checkbox group, and when I filter column using checkboxes, rows aren't highlighted.
afzal
create a dynamic action
"after refresh" report region
action == execute javascript code
like–
//– replace your conditional column with HIREDATE
$(‘.emp [headers=”HIREDATE”]’).each(function(index,element){
var x= element.innerHTML;
//console.log($(element).children().attr(‘data-id’));
var text= parseInt($(element).children().attr(‘data-id’));
if (text > 1){
$(this).closest(“tr”).children().css({“background-color”:”red”});
}
});
pavlos
Thanks a lot afzal, works 🙂
goto150
It's going to be a variation of the above: