Friday, July 30, 2021

Custom Chart & Custom Chart Color In Oracle Apex


 From Chart Attribute In Advance Option

JavaScript Initialization Code Section add Following Code :
========================================

function (options){

  function (options){

    options.dataFilter = function (data){

        data.series[0].color = "green";

        

        data.series[1].color = "red";

        data.series[2].color = "blue";

        data.series[3].color = "Yellow";

        data.series[3].color = "gray";

        return data;

    };

  // Add new 3D effect to existing chart style defaults   

     options.styleDefaults.threeDEffect = "on";

     return options;

    //options.styleDefaults = $.extend( options.styleDefaults, {threeDEffect: "on"});

   // return options;

}


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"});

  }

});

Sunday, July 4, 2021

Condition Based LOV(List of Value) In Oracle Apex



 List of Value Type: Pl/SQL Function Body Returning SQL


Declare 

  v_type varchar2(1) := :P45_RETURN_TYPE;

 Begin

  If v_type = 'C' then

    Return 'SELECT CUSTOMER_ID R,CUSTOMER_NAME D,CUSTOMER_NAME,CUSTOMER_PHONE,CUSTOMER_ADDRESS

            FROM CUSTOMER_INFORMATION WHERE CUSTOMER_ID IN(SELECT CUSTOMER_ID FROM INVOICE_MASTER)'

                 -- where some_column = ''CONDITION 1''

                  ;

  Else

     Return 'SELECT SUPPLIER_ID R,SUPPLIER_NAME D,SUPPLIER_NAME,SUPPLIER_PHONE,SUPPLIER_ADD

             FROM SUPPLIER_INFORMATION WHERE SUPPLIER_ID IN(SELECT SUPPLIER_ID FROM PRODUCT_RECEIVE_MASTER)'

                  --where some_column = ''CONDITION 2''

                  ;

  End if;

End;

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...