Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Javascript - Referencing report column value

586714Oct 3 2008 — edited Dec 4 2008
Hi,

In my application I have a report "Test" with some columns. In column "PFT_PCODE" the possible values are either 1 or 2.
What I want is to display the report table cell in red, if the value in "PFT_PCODE" is 1, or the table cell in orange, if the value in "PFT_PCODE" is 2, respectively.

I tried to make something in Javascript, based on a Vikas' example. I put in the

Region Header:

<style type="text/css">
.rot {
background-color: red;
}
.orange {
background-color: orange;
}
</style>


Region Footer:

<script type="text/javascript">
var spans=document.getElementsByTagName('span');
for (var j=0;j<spans.length;j++) {
if (spans[j].className=='farbe') {
var td=html_CascadeUpTill(spans[j],'TD');
if (document.getElementsById('#PFT_PCODE#').value == 1) {
td.className = 'rot';
}
else {
td.className = 'orange';
}
}
}
</script>

The column "PFT_PCODE" is marked as CSS class "farbe".

Unfortunately it's not working, I'm not sure if I reference the report column value right. Since I'm a beginner in Javascript I would be glad for help.

I put my (reduced) application on apex.oracle.com for testing.
Workspace: app
Login: roger.fatton@bl.ch
PW: riponi

Thanks in advance,

Roger
This post has been answered by ATD on Dec 4 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2009
Added on Oct 3 2008
16 comments
3,152 views