Friday, July 30, 2021

Classic Report Background Color Change (Based On Condition)


 1. Create Dynamic Action 

       => Execute JavaScript Code

Add Following Code in to Execute JavaScript Code Section:
=============================================

$('td[headers="ENTRY_STATUS"]').each(function() {  

  if ( $(this).text() === 'Weekend' ) {

    $(this).closest('tr').find('td').css({"background-color":"rgb(37 90 185 / 68%)"});

      $(this).closest('tr').find('td').css({"color":"black"});

      $(this).closest('tr').find('td').css({"font-weight":"bold"});

      $(this).closest('tr').find('td').css({"border":"1px solid #D6EAF8  !important"});

  }

   if ( $(this).text() === 'Govt. Holiday' ) {

    $(this).closest('tr').find('td').css({"background-color":"#4FA64F "});

      $(this).closest('tr').find('td').css({"color":"black"});

       $(this).closest('tr').find('td').css({"font-weight":"bold"});

      $(this).closest('tr').find('td').css({"border":"1px solid #D6EAF8  !important"});

  }

  if ( $(this).text() === 'Present' ) {

    $(this).closest('tr').find('td').css({"background-color":"ghostwhite"});

    $(this).closest('tr').find('td').css({"font-weight":"bold"});

  }

  if ( $(this).text() === 'Late' ) {

    $(this).closest('tr').find('td').css({"background-color":"#997570"});

      $(this).closest('tr').find('td').css({"color":"white"});

      $(this).closest('tr').find('td').css({"font-weight":"bold"});

  }

    if ( $(this).text() === 'Absent' ) {

    $(this).closest('tr').find('td').css({"background-color":"#E8453A"});

        $(this).closest('tr').find('td').css({"color":"white"});

        $(this).closest('tr').find('td').css({"font-weight":"bold"});

  }

    if ( $(this).text() === 'Leave' ) {

         $(this).closest('tr').find('td').css({"background-color":"yellow"});

         $(this).closest('tr').find('td').css({"color":"black"});

         $(this).closest('tr').find('td').css({"font-weight":"bold"});

  }

    

  if ( $(this).text() === 'Short Leave' ) {

        $(this).closest('tr').find('td').css({"background-color":"cadetblue"});

        $(this).closest('tr').find('td').css({"font-weight":"bold"});

  }

 if ( $(this).text() === 'Tour' ) {

    $(this).closest('tr').find('td').css({"background-color":"#117A65"});

    $(this).closest('tr').find('td').css({"color":"white"});

    $(this).closest('tr').find('td').css({"font-weight":"bold"});

  }

});

No comments:

Post a Comment

Image File store outside of Oracle Database and show image into Apex Application

Directory Create : grant execute on utl_file to HRMS; CREATE OR REPLACE DIRECTORY STOCK_DIRECTORY AS 'C:\Program Files (x86)\Apache Sof...