4 Replies Latest reply: Jul 19, 2013 3:59 AM by Yann39 RSS

    APEX_ITEM.DISPLAY_AND_SAVE : return value as number ?

    Yann39

      Hi,

       

      Apex 4.0.2.00.07, Oracle 11g r2.

       

      I need to use the APEX_ITEM.DISPLAY_AND_SAVE function in an interactive report (I need to be able to access its value using apex_application.g_f0x).

      The value displayed is a number value :

       

      SELECT
         [...],
         APEX_ITEM.DISPLAY_AND_SAVE(2, person_no),
         [...]
      FROM
         [...]
      WHERE
         [...]
      


      The problem is that this function returns a varchar2 value, so the column cannot be sorted correctly in the report.

       

      I can't find a way to display the value as a number in an interactive report...

       

      Any solution ?

       

      Thanks.

       

      Yann.

        • 1. Re: APEX_ITEM.DISPLAY_AND_SAVE : return value as number ?
          Recx Ltd

          You can append the HTML equivalent of APEX_ITEM.DISPLAY_AND_SAVE into the HTML Expression section of another text based column in the report.

           

          i.e. in the 'ENAME' column under 'HTML Expression'

           

          <input type="hidden" name="f02" value="#EMPNO#" />#ENAME#

           

          Set the 'ENAME' column to be 'Standard Report Column', the EMPNO numeric column can be sorted and is also returned. The htf.escape_sc is needed to avoid Cross-Site scripting in the report.

           

          The query is as follows;

           

          select EMP.EMPNO as EMPNO,

              htf.escape_sc(EMP.ENAME) as ENAME,

              EMP.JOB as JOB,

          from EMP EMP

          • 2. Re: APEX_ITEM.DISPLAY_AND_SAVE : return value as number ?
            Yann39

            Hi,

             

            indeed it is a solution.

            I think It's a makeshift job, but it works !

             

            EDIT: sorry but I just see that it does not work for an interactive report as there is no "HTML Expression" option available. I used Column link instead, redirecting to javascript:void(0).

             

            Thank you RecxLtd.

            • 3. Re: APEX_ITEM.DISPLAY_AND_SAVE : return value as number ?
              Recx Ltd

              Hi,

               

              I agree, it is a little 'makeshift', I had a re-think, perhaps this might be more acceptable to you;

               

              The query;

               

              select EMP.EMPNO as EMPNO,

                  EMP.ENAME ENAME as NAME,

                  EMP.JOB as JOB as JOB,

                  APEX_ITEM.HIDDEN(2, EMPNO) as DAS

              from EMP EMP

               

              Make sure the DAS column is "Standard Report Column"

              Make the DAS column heading a space character

              Untick all options in 'Allow Users To:'

               

              It is better if the DAS column is the last one on the report, it may also look strange if the report template has vertical bars in the columns. But looks fine here.

               

              regards

              • 4. Re: APEX_ITEM.DISPLAY_AND_SAVE : return value as number ?
                Yann39

                Hi,

                 

                indeed it is another solution.

                It is still not a "clean" solution for me, but thank you for sharing.

                 

                We are used to not being able to implement clean solutions using APEX