Interactive report sort text as number

Hello,
I was wondering if it is possible in an Apex interactive report to sort text as number?
For example, a series of text rows:
4
10
2
would sort as:
10
2
4
if it were text. What I would like to see is:
2
4
10
How could this be done?
Thanks.

If your column contains numbers only, you could use TO_NUMBER (column_name) column_name to convert it to a numeric value and it will sort it properly.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/otn/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
-------------------------------------------------------------------

Similar Messages

  • Interactive Report - sort strings/numbers in the same column

    Hi all,
    I have an interactive report and have a column value.
    It has type varchar2 in Database.
    Problem: There are existing numbers and chars in this column.
    Now I want to sort as numbers as chars.
    Now it's like this:
    10
    2
    23
    3
    no
    yes
    I want like this:
    2
    3
    10
    23
    no
    yes
    How can I receive this???
    All suggestions are welcome.

    without regexp option:
    select vc
    ,      case when instr('#1#2#3#4#5#6#7#8#9#0#',substr(vc,1,1)) = 0 then 1 else 0 end sort_column
    from 
    select '10' vc from dual union all 
    select '2'     from dual union all 
    select '23'    from dual union all 
    select '3'     from dual union all 
    select 'no'    from dual union all 
    select 'yes'   from dual union all
    select 'yas'   from dual
    order by 2,lpad(vc,'9',0)  --First sort on numbers, then on characters

  • Implementing Interactive Reports Sorts in Report Query

    My users love how the Interactive Reports work, especially being able to choose their sort fields. I have an Report Query that can use multiple sorts and many sort fields (chose from APEX page). Is it possible to implement this type of thing in the Report Query (without using decodes or dynamic SQL).
    I looked at the code being executed by Interactive Reports and can see the order by changing
    select
    null as apxws_row_pk,
    "CODE",
    "CITY_NAME",
    "STATE_CODE",
    "PK_ID",
    count(*) over () as apxws_row_cnt
    from (
    select * from (
    select "PK_ID",
    "CODE",
    "CITY_NAME",
    "STATE_CODE"
    from "#OWNER#"."ZIP"
    ) r
    ) r where rownum <= to_number(:APXWS_MAX_ROW_CNT)
    order by "CODE"

    Ben, Not sure I follow.
    I'm passing in the column names of the order by's from my APEX page to the DB function. Right now I'm doing a huge case statement for each one.
    FUNCTION get_student_demographic (l_user in varchar2,
    l_owner in varchar2,
    l_report_order1 in varchar2,
    l_report_order2 in varchar2,
    l_report_order3 in varchar2,
    l_report_order4 in varchar2,
    SELECT (CASE l_report_order1
    WHEN '%null%' THEN ''
    WHEN 'LAST_NAME' THEN A.LAST_NAME
    WHEN 'FIRST_NAME' THEN A.FIRST_NAME
    ..... many more
    ELSE ''
    END ) report_order1,

  • Interactive report Sort option

    Hi,
    Is there any way to show "Null always last" as default in Null sorting option of sort window for all interactive reports in entire application/workspace/system.
    I was trying to modify "apex_ns_3_1.js" but I think.....I am confused.
    Please suggest the way if we could do this in safe manner.
    Apex Version: Application Express 3.1.1.00.09
    Current look of sort window:
          Column                   Direction                         Null sorting
    1    -Select Column-       Ascending                        Default
    2    -Select Column-       Ascending                        Default
    3    -Select Column-       Ascending                        Default
    4    -Select Column-       Ascending                        Default
    5    -Select Column-       Ascending                        Default
    6    -Select Column-       Ascending                        Default
    Expected:
          Column                   Direction                         Null sorting
    1    -Select Column-       Ascending                        Nulls always last
    2    -Select Column-       Ascending                        Nulls always last
    3    -Select Column-       Ascending                        Nulls always last
    4    -Select Column-       Ascending                        Nulls always last
    5    -Select Column-       Ascending                        Nulls always last
    6    -Select Column-       Ascending                        Nulls always last

    Sachin,
    Are you not able to add an order by clause to the main query and default the ordering there? Also, when you create an Interactive Report as a developer you should be able to set/save the settings for the default.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • Apex 3.1, Interactive Report Row Text Search, image bitmap as TEXT?

    I think this IR thing is powerful which could save me lots of time in development.
    One question: does the row text search(default: all columns) treat image column as regular text(string)? I did the following search on:
    SAMPLE APPLICATION-->Products, I put 300 in the search column( for $300 list-price search), the search produces 3 lines( should only have 2). the 3rd line's list price is $1999, I looked it in SQL*PLUS and saw its image bitmap (long string) includes a "300" inside, so I believe the "default all columns search" treat image as regular string.
    How can I avoid the image bitmap search included in IR? This bitmap strings are very long for each image and can EASILY match searching conditions for something like PRODOUCT DESCRIPTION, PRODUCT PRICE for our products data( about 25000)? thanks
    sean

    Sean / Russell,
    Thanks for reporting this, it's certainly a bug.
    By the way, the search is performed in SQL, on whatever column values are being displayed (run the page in debug mode to see the full SQL). So in the case of the sample application, it is not matching the image bitmap, but the image size, which is selected in the SQL. The bug is that the full search should not include columns which have filtering disabled or one of the special image format masks. We'll try to fix this for an upcoming patch.
    Thanks,
    Marco

  • Question on Interactive Report feature sorting

    Hi,
    I have about over 10,000 records and used the interactive report feature on Apex. For some reason, on the timestamp column, I tried to resort in the latest date and it only shows the latest date of last year and didn't show the latest date of 2010. I tried changing the timestamp column to sort by descending, and it doesn't show any latest date in 2010, only 2009.
    Could this be an issue with the interactive report issue.
    Thanks,
    Michael

    Hi,
    If you have default 10,000 row limit in interactive report , sorting work only for that record set.
    Increase rows that report show, or you can use ORDER BY in report select to get e.g. 10,000 latest row.
    Br,Jari

  • Interactive Report BUG (hangs when sorting columns)

    Hi All,
    i have an interactive report, and when i click on a column to sort the data the report hangs.
    To circle in the screen keeps circeling and on the botom and i get an javascipt error in the apex_3_1.js file.
    i am working with apex 3.2.1.00.02 with an oracle 10G DB.
    I also can reporduce this error. When i have an interactive report in which the sorting works properly and i copy this page to a new page i get a report in which the interactive report sorting is not working.
    Can you please help me in resolving the issue, or is this a known bug ?
    Regards,
    Marco Schlicher

    Hello,
    I came across the same issue. I made a test IR report with the following query
    SELECT '<span class="blue">'||id||'</span>'||name as n_name, id
    FROM
    +(SELECT ''||fullname||'' name, id from users)+
    It all works fine on FF but IE returns this
    Webpage error details
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0; InfoPath.2; AskTB5.5)
    Timestamp: Wed, 5 May 2010 07:53:11 UTC
    Message: Unknown runtime error
    Line: 1
    Char: 9270
    Code: 0
    URI: http://localserver/i/javascript/apex_3_1.js
    Using the IE debugging tool, error occurs upon this
    function $dom_AddTag(E,A,C)
    +{+
    var D=document.createElement(A);
    var B=$x(E);
    +if(B){B.appendChild(D)}+
    +if(C!=null){D.innerHTML=C}+
    return D}
    It all works fine if I remove the <a href... tag...But I need it and I can't use the column properties since it's quite a huge list of if's for the link creation.
    Thanks,
    Andrea

  • Check all checkbox in an interactive report

    Hi,
    I would like to add a "check all" functionality in an interactive report. I've done that by adding a javascript function to the header, but when I click the column header to check all the page first executes the javascript that is used by the interactive report (sorting etc). Is there a way to disable this javascript for just the checkbox clolumn, so that my own javascript code is executed?
    Or is there another way to add this functionality to the IR?
    Thanks

    That works great! Thanks jarola
    The complete answer in case anyone needs it is to first include the checkbox column in your IRR query
    APEX_ITEM.checkbox (1, ca.id) del
    Then include this as the column heading
    <input type="Checkbox" onclick="$f_CheckFirstColumn(this)">
    Then include the code as identified by jarola in the page HTML Header
    <script type="text/javascript">
    addLoadEvent(RemoveChkOnclick)
    function RemoveChkOnclick(){
    $x('apexir_DEL').onclick='';
    </script>
    Edited by: Bill Wheeling on Aug 1, 2010 4:12 AM
    Edited by: Bill Wheeling on Aug 1, 2010 4:36 AM

  • Interactive report PDF download

    Hi,
    PDF output is not proper when interactive report is having more number of columns. I have a interactive report with 40 columns. I tried to change Page attributes in print attributes tab. But there is no change.
    Please tell me what setups to be done for this.
    Regards
    Mohan

    hi ,
    i think you need to configure BIpublisher to setup inside your server to get the pdf output from apex report.
    http://www.rittmanmead.com/2008/04/21/oracle-apex-and-bi-publisher/
    thanks
    Mark Wyatt

  • "Invalid number" error using Interactive Report search  on collection

    hi -- I have several interactive reports based on collections. In the IR reqion query definition,
    I cast the collection values as needed (number, date, etc). Everything's been working great.
    In both development and production, I can use the search feature of interactive reports
    and it finds rows containing the text I type in (as well as everything else working fine...)
    I just imported a new version of an application into our production database. Now, when I use the
    interactive report search, I always get "invalid number". This even happens on interactive reports
    that still work in the previous version of the production application... and these IRS
    have not been modified at all.
    If I create a filter and search for "elevation" in a string column, the filter works. If I create a filter
    searching for "elevation" in a number column, I get "invalid number". (In the development
    environment, I can do the latter -- it just doesn't find any rows.)
    Clearly it's choking on the types of the columns in the IR... but why now and not before, and why
    in the production database but not the development DB? Both are running 4.0.1.00.03.
    This is a pretty major loss of functionality... and it comes at a really bad time... Help?!
    Thanks,
    Carol

    hi Andy, Tony -- Completely understand about your email address. I've actually wondered at the fact that any
    of you gurus are willing to give them out.
    It's not tons of stuff, so here it is.
    1) The application process that creates the collection. This process that runs whenever an IR
    page is being rendered. The various DB names are application items. This application can affect data
    on multiple databases. You'll see see this in the process that builds the query.
    IF (apex_collection.collection_exists (      
        p_collection_name=>'IR_COLLECTION')) then
        apex_collection.delete_collection(p_collection_name=>'IR_COLLECTION');
    END IF;
    apex_collection.create_collection_from_query_b(p_collection_name=>'IR_COLLECTION', p_query=>meta_data_pkg.build_ir_collection_query(:TABLE_NAME, :MASTER_DB_NAME, :CZAR_DB_NAME, :DB_NAME));2) The database function that constructs the query. Called in the above create_collection statement.
    FUNCTION build_ir_collection_query (table_name varchar2, master_db_name varchar2, czar_db_name varchar2, ref_db_name varchar2)
    return varchar2
    IS
      query VARCHAR2(3000);
    BEGIN
      IF /* check for other table names here */ THEN
        -- build queries for other tables
       -- *** HDB_EXT_DATA_CODE
      ELSIF (upper(table_name) in ('HDB_EXT_DATA_CODE', 'HDB_EXT_DATA_CODE_SYN')) THEN
        query := 'SELECT /*+DRIVING_SITE(dcs)*/ dc.ext_data_code_sys_id, dcs.ext_data_code_sys_name, dcs.agen_id, a.agen_name, dc.primary_data_code,';
        query := query||' dc.secondary_data_code, dc.hdb_datatype_id, d.datatype_name, d.unit_id, u.unit_name, d.physical_quantity_name, to_char(dc.date_time_loaded,''DD-MON-YYYY HH24:MI:SS'')';
        query := query||' FROM hdb_ext_data_code_syn@'||master_db_name || ' dc, hdb_ext_data_code_sys_syn@'||master_db_name ||
                 ' dcs, hdb_agen_syn@'||master_db_name||' a, hdb_datatype_syn@'||master_db_name||' d, hdb_unit@'||czar_db_name||' u';
        query := query||' WHERE dc.ext_data_code_sys_id = dcs.ext_data_code_sys_id AND dcs.agen_id = a.agen_id(+) AND dc.hdb_datatype_id = d.datatype_id AND d.unit_id = u.unit_id';
       /* continue w/ other tables */
    END;3) The query that it builds for the table in question:
    SELECT /*+DRIVING_SITE(dcs)*/ dc.ext_data_code_sys_id, dcs.ext_data_code_sys_name, dcs.agen_id, a.agen_name,
    dc.primary_data_code, dc.secondary_data_code, dc.hdb_datatype_id, d.datatype_name, d.unit_id, u.unit_name,
    d.physical_quantity_name, to_char(dc.date_time_loaded,'DD-MON-YYYY HH24:MI:SS')
    FROM hdb_ext_data_code_syn@UCHDB2 dc,  hdb_ext_data_code_sys_syn@UCHDB2 dcs, hdb_agen_syn@UCHDB2 a,
    hdb_datatype_syn@UCHDB2 d, hdb_unit@UCHDB2 u
    WHERE dc.ext_data_code_sys_id = dcs.ext_data_code_sys_id AND dcs.agen_id = a.agen_id(+)
    AND dc.hdb_datatype_id = d.datatype_id AND d.unit_id = u.unit_id           4) The explain plan results on the development database
    PLAN_TABLE_OUTPUT                                                                                  
    Plan hash value: 583729845                                                                         
    | Id  | Operation                       | Name                  | Rows  | Bytes | Cost (%CPU)| Time
        | Inst   |                                                                                     
    |   0 | SELECT STATEMENT REMOTE         |                       |    97 | 16490 |    19  (16)| 00:00
    :01 |        |                                                                                     
    |*  1 |  HASH JOIN                      |                       |    97 | 16490 |    19  (16)| 00:00
    :01 |        |                                                                                     
    |   2 |   TABLE ACCESS FULL             | HDB_UNIT              |   177 |  3540 |     3   (0)| 00:00
    :01 | UCHDB2 |                                                                                     
    |*  3 |   HASH JOIN RIGHT OUTER         |                       |    95 | 14250 |    15  (14)| 00:00
    :01 |        |                                                                                     
    |   4 |    TABLE ACCESS FULL            | HDB_AGEN              |    54 |  1944 |     3   (0)| 00:00
    :01 | UCHDB2 |                                                                                     
    |*  5 |    HASH JOIN                    |                       |    95 | 10830 |    12  (17)| 00:00
    :01 |        |                                                                                     
    |   6 |     MERGE JOIN                  |                       |   112 |  5936 |     6  (17)| 00:00
    :01 |        |                                                                                     
    |   7 |      TABLE ACCESS BY INDEX ROWID| HDB_EXT_DATA_CODE_SYS |    15 |   405 |     2   (0)| 00:00
    :01 | UCHDB2 |                                                                                     
    |   8 |       INDEX FULL SCAN           | HDB_EXT_DATA_CODE_SYS |    15 |       |     1   (0)| 00:00
    :01 | UCHDB2 |                                                                                     
    |*  9 |      SORT JOIN                  |                       |   112 |  2912 |     4  (25)| 00:00
    :01 |        |                                                                                     
    |  10 |       TABLE ACCESS FULL         | HDB_EXT_DATA_CODE     |   112 |  2912 |     3   (0)| 00:00
    :01 | UCHDB2 |                                                                                     
    |  11 |     TABLE ACCESS FULL           | HDB_DATATYPE          |   711 | 43371 |     5   (0)| 00:00
    :01 | UCHDB2 |                                                                                     
    Predicate Information (identified by operation id):                                                
       1 - access("A2"."UNIT_ID"="A1"."UNIT_ID")                                                       
       3 - access("A4"."AGEN_ID"="A3"."AGEN_ID"(+))                                                    
       5 - access("A5"."HDB_DATATYPE_ID"="A2"."DATATYPE_ID")                                           
       9 - access("A5"."EXT_DATA_CODE_SYS_ID"="A4"."EXT_DATA_CODE_SYS_ID")                             
           filter("A5"."EXT_DATA_CODE_SYS_ID"="A4"."EXT_DATA_CODE_SYS_ID")                             
    Note                                                                                               
       - fully remote statement                                                                         5) The explain plan results on the production database
    PLAN_TABLE_OUTPUT                                                                                                                                                                  
    Plan hash value: 583729845                                                                                                                                                         
    | Id  | Operation                       | Name                  | Rows  | Bytes | Cost (%CPU)| Time     |                                                                          
    |   0 | SELECT STATEMENT                |                       |    97 | 16490 |    19  (16)| 00:00:01 |                                                                          
    |*  1 |  HASH JOIN                      |                       |    97 | 16490 |    19  (16)| 00:00:01 |                                                                          
    |   2 |   TABLE ACCESS FULL             | HDB_UNIT              |   177 |  3540 |     3   (0)| 00:00:01 |                                                                          
    |*  3 |   HASH JOIN RIGHT OUTER         |                       |    95 | 14250 |    15  (14)| 00:00:01 |                                                                          
    |   4 |    TABLE ACCESS FULL            | HDB_AGEN              |    54 |  1944 |     3   (0)| 00:00:01 |                                                                          
    |*  5 |    HASH JOIN                    |                       |    95 | 10830 |    12  (17)| 00:00:01 |                                                                          
    |   6 |     MERGE JOIN                  |                       |   112 |  5936 |     6  (17)| 00:00:01 |                                                                          
    |   7 |      TABLE ACCESS BY INDEX ROWID| HDB_EXT_DATA_CODE_SYS |    15 |   405 |     2   (0)| 00:00:01 |                                                                          
    |   8 |       INDEX FULL SCAN           | HDB_EXT_DATA_CODE_SYS |    15 |       |     1   (0)| 00:00:01 |                                                                          
    |*  9 |      SORT JOIN                  |                       |   112 |  2912 |     4  (25)| 00:00:01 |                                                                          
    |  10 |       TABLE ACCESS FULL         | HDB_EXT_DATA_CODE     |   112 |  2912 |     3   (0)| 00:00:01 |                                                                          
    |  11 |     TABLE ACCESS FULL           | HDB_DATATYPE          |   711 | 43371 |     5   (0)| 00:00:01 |                                                                          
    Predicate Information (identified by operation id):                                                                                                                                
       1 - access("D"."UNIT_ID"="U"."UNIT_ID")                                                                                                                                         
       3 - access("DCS"."AGEN_ID"="A"."AGEN_ID"(+))                                                                                                                                    
       5 - access("DC"."HDB_DATATYPE_ID"="D"."DATATYPE_ID")                                                                                                                            
       9 - access("DC"."EXT_DATA_CODE_SYS_ID"="DCS"."EXT_DATA_CODE_SYS_ID")                                                                                                            
           filter("DC"."EXT_DATA_CODE_SYS_ID"="DCS"."EXT_DATA_CODE_SYS_ID")                                                                                                             6) This is the source query for the interactive report in question. The application process that creates the
    collection runs before this region is rendered.
    Select /*+ NO_QUERY_TRANSFORMATION */
    to_number(C001) Ext_Data_Code_Sys_Id,
    C002 Ext_Data_Code_Sys_Name,
    to_number(C003) Agen_Id,
    C004 Agen_Name,
    C005 Primary_Data_Code,
    C006 Secondary_Data_Code,
    to_number(C007) Hdb_Datatype_Id,
    C008 Datatype_Name,
    to_number(C009) Unit_Id,
    C010 Unit_Name,
    C011 Physical_Quantity_Name,
    C012 Date_Time_Loaded
    from apex_collections
    where collection_name = 'IR_COLLECTION'
    order by 1,5,7Well, maybe it is alot... !
    Happy New Year!
    Carol

  • Interactive Report (IR) column heading: filtered items number & flashlight

    Hello everyone
    several hours of searching through the forum did not provide me with leads or answers to 2 questions. Both are related to the IR column heading menu and options. Let's start with a copy of the relevant portion of the interactive report help screen:
    Column Heading Menu
    Clicking on any column heading exposes a column heading menu.
    [snip]
    Text Area is used to enter case insensitive search criteria (no need for wild cards). Entering a value will reduce the list of values at the bottom of the menu. You can then select a value from the bottom and the selected value will be created as a filter using '=' (e.g. column = 'ABC'). Alternatively, you can click the flashlight icon and the entered value will be created as a filter with the 'LIKE' modifier (e.g. column LIKE '%ABC%').
    List of Unique Values contains the first 500 unique values that meet your filters. If the column is a date, a list of date ranges is displayed instead. If you select a value, a filter will be created using '=' (e.g. column = 'ABC').
    Q1: Why do I not see a flashlight icon? I looked everywhere in the report definition to "enable" it, to no avail.
    Q2: Although we've found IRs to be incredibly useful and embraced by end users, we are having issues when dealing with large datasets. Let's look at searching for people's first/last name in our CONTACTS table. The table is ~28,000 names long. If one attempts to use Column Heading menu to "filter" for any name outside the first 500 unique values, the search does not work. Yes, I know that a workaround is to use Actions Menu icon filter... but, it sure is misleading to have a search which does not go beyond letter B in the list of last names. Furthermore, I do not see a way to DISABLE Column Heading Text Area, and avoid user confusion.
    I suspect that "List of Unique Values contains the first 500 unique values" was set for the performance purposes. Is there a way to set that number anywhere? Have it customized for each column? (columns county and state could be <100, for example)
    Thanks an advance to any advice.
    Vojin

    @Prabodh: what you say is only changing the default image for the column selector at the search bar level. What i think is being looked for is an icon on the popup when a column header is clicked in an IR. Don't bother: there is none.
    @Vojin, Tonibony:
    I also ran into this problem with IRs and the useless column header box. If you want to hide the unique values list, it is a bother. First of all, you can't disable the finding of values, this is embedded in the widget ajax code. Then if you want to just hide the list, there is no real event you can hook up to. The poping up of the box is an ajax callback, and is part of the IR javascript, but this callback does not trigger any event (no apexafterrefresh for example, which is understandable). I've worked around this by overriding/extending the method which is called when ajax is done loading within the IR code. Here is a piece of code which does this (call it on page load):
       // _Finished_Loading is called when the IR is done with a GET action
       // because the posts are synchronous in this report, and no events
       // or hooks are available, the best way to preserve functionality
       // yet extending it is to override the original function, yet
       // keep the base code
       // apexafterrefresh cant be used since it is not triggered after
       // the widget ajax
       var or_Finished_Loading = gReport._Finished_Loading;
       gReport._Finished_Loading = function(){
           //overriden, but still have to call orinigal!
          or_Finished_Loading();
          //SORT_WIDGET is the widget containing all the header elements
          if(gReport.current_control=='SORT_WIDGET'){
             // hide the original dropdown box
             $("#apexir_rollover_content").hide();
       };If you're interested, i've recently developed a plugin for use in my interactive reports which works around some of these limitations. For me, the headers are much more userfriendly than the actions > filter menu. So what i've done is: hide the orignal dropdown, and turn the searchfield into an autocompletion field, which will progressively search through the distinct column values in the IR with ajax. I've even made an option to have the searching behave like a "contains" or a "like". I'm working on a post about it, with background, documentation and source code. I'll add a post here when i finish it up, you can see if that helps you.
    I also would like to add a button later on which will simply add the entered value as a "like %value%" filter. I know how to do this and what to do, i'm just a bit short on time at the moment. I actually think that adding the button in the layout may be the hardest part... :')

  • Sort order in an interactive report

    In APEX 4.1 I am trying to create an interactive report based on a table that's similar to the following:
    id - number
    colA - varchar2
    colB - varchar2
    colC - date
    colD - varchar2
    In the IR, I'd like to have break on column A so that the report displays as follows:
    colA
    id, colb, colB, colC, colD
    I want the sort order for column A to be based on the ID column, but I find that APEX displays it in alpha order based on the value for column A. I could include the value for ID in the break, but since it only has meaning inside the database, it leads to confusion among the users. I read some other posts where people have included the ID field and then used javascript to hide it in the report. I was wondering if there might be an alternative solution.

    AT USER-COMMAND.
    CASE SY-UCOMM.
    WHEN 'BACK'.
    IF SY-LSIND = 5.
    SY-LSIND = 1.
    ENDIF.
    ENDCASE.
    YOU CAN ASSIGN THE VALUE FOR SY-LSIND .
    <b>DEMO_LIST_INTERACTIVE_3</b> Refer this
    reward if this helsp.
    Message was edited by:
            Judith Jessie Selvi

  • Get row number of record in Interactive Report

    I am using an interactive report and want to be able to modify a field and if the value already exists in the database change it back to what it was originally. I am selecting data using the select statement below and I'm calling the javascript CheckExists function when the value changes. All this is working but I need to figure out how to get the row number so I can change the value back to what is in f03 in the same row. Does anyone know how to access the row number or know how I can do this?
    select apex_item.checkbox(1, RESOURCE_TYPE_ID, 'onchange="CheckUsed(this, this.value);"', ':') "Delete",
    apex_item.text(2, RESOURCE_TYPE, 20, 100, 'onchange="CheckExists(this, this.value);"' ) "RESOURCE_TYPE",
    RESOURCE_TYPE_ID,
    apex_item.text(3, RESOURCE_TYPE, 20, 100) "orig_resource_type"
    from resource_types
    order by RESOURCE_TYPE

    Scott,
    I was not able to find anything like using #ROWNUM# that would give me the current row number but I was able to get it if I looped through all the records until I found the record I was currently on. It is not really what I wanted to do but it works. I have included the code below.
    Thanks a lot for your help I appreciate it.
    Steve
    *** Interactive Report Select statement ***
    select apex_item.checkbox(1, RESOURCE_TYPE_ID, 'onchange="CheckUsed(this);"', ':') "Delete",
    apex_item.text(2, RESOURCE_TYPE, 20, 100, 'onchange="CheckExists(this);"' ) RESOURCE_TYPE,
    RESOURCE_TYPE_ID,
    apex_item.text(3, RESOURCE_TYPE, 20, 100) ORIG_RESOURCE_TYPE
    from resource_types
    order by RESOURCE_TYPE
    *** Javascript ***
    function CheckUsed (pResourceType)
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=ResourcesResourceTypeExists',0);
    get.add('TEMPORARY_ITEM', pResourceType.value);
    gReturn = get.get();
    if (gReturn > 0)
    alert('Resource records exist using the Resource Type; Unable to delete.');
    pResourceType.checked=false;
    function CheckExists (pResourceType)
    // Get the current row number.
    var lResourceTypeId = document.getElementsByName("f01");
    var lResourceType = document.getElementsByName("f02");
    var lOrigResourceType = document.getElementsByName("f03");
    var j;
    for (j = 0; j < lResourceType.length; j++)
    if (lResourceType[j].value == pResourceType.value)
    if (lResourceType[j].value != lOrigResourceType[j].value)
    break;
    } // if (lResourceType[j].value != lOrigResourceType[j].value)
    } // if (lResourceType[j].value == pResourceType.value)
    } // for (j = 0; j < lResourceType.length; j++)
    // Check if the Resource Type already exists.
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=ResourceTypeExists',0);
    get.add('TEMPORARY_ITEM', pResourceType.value);
    gReturn = get.get();
    if (gReturn > 0)
    // Reset the Resource Type to the original Resource Type.
    get.add('lResourceType[j]', lOrigResourceType[j].value);
    doSubmit('SUBMIT');
    else
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=UpdateResourceType',0);
    get.add('TEMPORARY_ITEM', pResourceType.value);
    get.add('TEMPORARY_ITEM_2', lResourceTypeId[j].value);
    gReturn = get.get();
    alert(gReturn );
    }

  • Retrieving sort and filter criteria for interactive report

    I have developed a test management system in APEX. Users log in and see an interactive report with their assignments. Each test they've been assigned occupies one row.
    There is an "Execute" link for each row that takes the user to the test execution page, where they can see the input steps / expected results and report the test passing or failing.
    I've implemented "Next >" and "< Previous" buttons on the execution page, so the user can immediately go forwards or backwards in his assigned tests without having to return to the assignments page and click the Execute link on the next or previous row.
    The test execution page figures out what the next and previous assigned test is using the LAG and LEAD functions, like this:
    lag(assignment_id) over (order by ref_num_full) prev_id,
    lead(assignment_id) over (order by ref_num_full) next_id
    Notice that I've "hardcoded" the over clause to be the reference number of the test.
    The problem here - this solution ignores any custom sorts or filters the user has put in place on the assignments (interactive) report.
    Is there a way I can "grab" the interactive report (1) sort criteria and (2) filter criteria dynamically? I'm thinking I could then use dynamic SQL to build an OVER clause used in the lag/lead calls so that the application now follows whatever sort and/or filter criteria the user has put in place.
    Any help is greatly appreciated...thanks!!

    Thanks WTine!
    I took a look and determined
    - I can get the sort criteria from the APEX_APPLICATION_PAGE_IR_RPT view (SORT_COLUMN_# and SORT_DIRECTION_# columns)
    - I can get the filter criteria from the APEX_APPLICATION_PAGE_IR_COND view
    Regards, Rich

  • Can i have more than 6 columns to sort in interactive reports  in apex 4.1?

    As of  now on clicking on Actions->format->sort only a select list with six columns is displayed in an interactive report . Is there any possibility to add more number of columns in this ? Can anyone help?

    Hey there. WELCOME to the world of Macintosh. You are in for a great ride with this machine and platform.
    Some good news for you regarding cameras. The neat thing about iPhoto, and indeed, the Mac, is that there is no setup required for hooking your camera to iPhoto. In fact, ANY camera you plug into the Macintosh that it recognizes will automatically work with iPhoto!
    I regularly use three different cameras with my iPhoto application. As soon as I plug into the USB port and power on my camera, the Mac figures out that it needs to start up iPhoto. iPhoto figures out how to talk to the camera, and gives me the option to import pictures from the memory card... no configuration, no extra software to install. I do this with a Canon camera, and two different Sony models.
    It's painless!
    If you find this message helpful or if it solves your problem, please indicate this by clicking the appropriate icon in the header of this reply.

Maybe you are looking for

  • Looking for app to view my webcam

    Are there any apps that would allow me to view my webcam from my phone, say i hook up a webcam to my computer and use it as a security camera and be able to view it while im out and away on my phone?

  • Custom Report Headers with sorting

    Hi All! I was wondering if there is any "substitution string" for the sorting option in the report headers... I have this type of pl/sql report header: (function returning varchar2) <tr> <th rowspan="2" class="t23ReportHeader_sp">XXXXX</th>: <th rows

  • HP Notebook PC Battery Pack Replacemen​t Program

    HP Notebook PC Battery Pack Replacement Program I have got a computer and I've just found out on the website that its battery is available to replace. The battery can be a dangerous because it can explode. I've called to a service in Poland and they

  • Photoshop CS4 for Windows - Installing XP 64

    I have heard that Photoshop CS4 is not meant to be used on XP 64 but has anyone here installed it successfully? Is it working? I am trying to install it on my XP 64 PCs and no go. One of them gets pretty far into the installation process and conks ou

  • Multi media hdd

    Hi, I use FCE 4.0 and export hd videos in .mov and also in mpeg 4 (h.264). I want to store this videos on a multi media hdd to see it on a hd television in hd resolution. But I cant find anything. me2 and fantec dosn´t work. What can I doe? Sincerly.