1 Reply Latest reply on Nov 14, 2017 3:39 PM by -W.

    APEX_ITEM.TEXT calculation

    SMNA

      Hi I am new to Apex 5.0, Please kindly help me to solve the problem.

      Using Oracle 11g

                 Apex 5.0

                 Classic Report

       

      I have 2 apex items as below

       

      APEX_ITEM.TEXT(3,Full_casual_leave_cnt) as fcasual_leave_cnt

      APEX_ITEM.TEXT(4,Half_casual_leave_cnt) as hcasual_leave_cnt

       

      Based on above 2 apex items value i need to calculate the value and it should  display in the 3rd apex item(APEX_ITEM.DISPLAY_ONLY).

       

      When the the value changes in first 2 text items then automatically the value should be changed in 3rd apex item.

        • 1. Re: APEX_ITEM.TEXT calculation
          -W.

          Hello,

          first I would suggest to not use a Classical Report for doing this, instead use the Interactive Grid.

          Your query could look similar to

          select ..., Full_casual_leave_cnt, Half_casual_leave_cnt, (Full_casual_leave_cnt+Half_casual_leave_cnt) as calc_column

          Define the calc_column as Query only = "Yes"

          Then you can declare two Dynamic Actions on the two Full_casual_leave_cnt and Half_casual_leave_cnt

          When: "Change"

          Action: "Execute PL/SQL Code"

          Code: :calc_column := .Full_casual_leave_cnt + :Half_casual_leave_cnt (use the : for binding the column values)

          Items to Submit: Full_casual_leave_cnt, Half_casual_leave_cnt

          Items to Return: calc_column

          Hint: When you are expecting NULL values you should work with NVL(column,0) expressions

          Kind regards,

          -W