Jump to content
  • 0

Changing Colors of Values in Pivot Table


kpcollier

Question

Trying to do something similar to this post 

However, its a bit different. I have a Trainings Table with records of all Trainings/Certificates our employees need. These records are being used as fields at the top of my pivot table. On the left side are Employee Names coming from an Employee Table. Thirdly, there is a CertificateTable that pulls them together. This table consists of the employee name, trainer, training, issue and expiration dates. 

The Values for this Pivot Table are the Expiration Dates in short date form, which is a field in the CertificateTable. Is there a way I can make the cell alone (not the entire column or row) turn red if that date is within 30 days of expiring?

I can't insert an HTML Block on the Pivot Table Wizard, however it allows me to insert a header and footer.

Thanks.

5HPUbM.jpg

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

I can get it to work on the Drill Down Report (results) page with this script..

<script>
var isi = document.getElementById("visi[@field:Certificate_Table_Certificate_Number]");
 var now = new Date();
var expiration = new Date("[@field:Certificate_Table_Expiration_Date*]"); 
if(expiration < now){
isi.innerHTML = '[@field:Certificate_Table_Expiration_Date*]';
isi.style.backgroundColor='red';
}
else{
isi.innerHTML = '[@field:Certificate_Table_Expiration_Date*]';
}
</script>

Works great in every way besides being on the right page. :huh: Tried splitting it up with the div in the header and the script in the footer and it doesn't work. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...