Interactive report - order column by other column values

Hi Oracle experts,
could you please advise how to order column A by values of column B in Interactive report ?
When clicking on header of "Countries" column in order to sort it acs/desc I would like to order it by values of column "Sort_order" which stores values from 1 to 100.
The goal is to order "Countries" not alphabetically, but according to values of "Sort_order" column.
Any ideas?
Thanks in advance for your help.
Best regards,
Konrad

962622 wrote:
Hi Oracle experts,Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "962622".
When you have a problem you'll get a faster, more effective response by providing as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
could you please advise how to order column A by values of column B in Interactive report ?
When clicking on header of "Countries" column in order to sort it acs/desc I would like to order it by values of column "Sort_order" which stores values from 1 to 100.
The goal is to order "Countries" not alphabetically, but according to values of "Sort_order" column.
Any ideas?I'm not an expert on Interactive Reports, so there may be a less brute force method using the built-in features, but here's an approach that's worked in the past.
Modify the query to generate the column as:
'<!-- '|| to_char(sort_order, '009') || ' -->' || countryi.e. prefix the country name with an HTML comment containing the required ordinal number. This won't be visible in the report, but will be considered when sorting in SQL.
In the IR Column Attributes set the column's Display Text As property to Standard Report Column so APEX won't escape the HTML tags.
This method has side effects: some IR filters won't work; aggregate calculations can't be applied to the column; and report exports contain the HTML rather than the expected value.
Edited by: fac586 on 02-Oct-2012 13:28
From APEX 4.2 IR columns have support for HTML Expressions, so Re: Report formatting/sorting issue using a hidden column and HTML Expression should be used, as it's purely declarative and provides better separation of concerns. (Still a problem on report exports though. Whilst the sort column can be suppressed using a condition, the hidden column can't be "unhidden" to replace it.)

Similar Messages

  • How to copy data from one column to other column

    hi,
    can any one tell me how to copy data of  one column to other column for some specific data
    example
    productno  ocalyear        actualsales  prevplansales   currentplansales
    p001       2007                  100              120                   
    p002       2007                   90               100
    p003       2007                  120              130
    p004       2007                  140              120
    p005       2007                  150              150
    i want to copy data of p001 and p002 from prevplansales to current plansales
    productno  ocalyear        actualsales  prevplansales   currentplansales
    p001       2007                  100              120              120     
    p002       2007                   90               100              100
    p003       2007                  120              130
    p004       2007                  140              120
    p005       2007                  150              150
    is it possible to do?
    please suggest me.
    i will assign points

    Hi,
    I think the needed techniques are already described in the documentation, e.g. in
    http://help.sap.com/saphelp_nw70/helpdata/en/45/e641e4c61256dee10000000a114a6b/frameset.htm
    or
    http://help.sap.com/saphelp_nw70/helpdata/en/45/e641e4c61256dee10000000a114a6b/frameset.htm
    The main techiques used in the above example to bind the filter of the planning function to selected (marked) objects in the analysis item or to drop down boxes (or both). These techniques are used in the above examples.
    Regards,
    Gregor

  • Interactive report conditional display of link column - apex 4

    I create an interactive report
    select object_id,
           object_name,
           case
            when mod(rownum, 2) = 0
            then 'block'
            else 'none'
           end  display_link
    from user_objects
    where rownum <= 10in the Link Column for the report I selected one of the edit icons and put the following in the link attributes
    style="display:#DISPLAY_LINK#"I also edited the object_id and set the Column Link and selected an edit icon and put the same style in the link attributes.
    The link under the column displays correctly but the link for the report does not seem to substitute the #DISPLAY_LINK# from the report. Any Ideas?

    Here's how I've done this:
    SELECT ORG_ID,
           CLEARER_NAME,
           LEGAL_NAME,
           MARGINING_ACCOUNT,
           RULE_GROUP_DESCR,
           VIOLATION_COLOR,
           VIOLATION_LEVEL,
           CASE MARGIN_IND
            WHEN 'Y' THEN '&nbsp'
            ELSE '<a href="#" title="Ignore This Alert"><img src="/i/ice/images/hide.png" alt="Ignore"></a>'
           END AS IGNORE_LINK,
           ....This takes care of either showing (or not showing) the link.
    IN order to process when it is present, not that the address is "#" This will cause your cursor to change to a hand (or whatever your pointer is) when the mouse floats over the link. The actual transfer to the next page, I handle with jQuery/JavaScript.
    Create a Dynamic Action.
    Event: Click
    Selector Type: jQuery Selector
    jQuery Selector: 'aalt'
    Event Scope: Live
    (note that the jQuery Selector is finding the alt attribute that I set on my link in the SELECT above . Tweak as needed.
    This "Action" for this DA will be to "execute JavaScript code"
    Normally, I would set some values into Page Items and then create a branch to pass this values to the next page. I am doing the same thing in the following code. I am getting the values off of the row wherein the user clicked on the link. I am setting these values from the row into the page item values. Then, I am submitting the page. All the "htmldb_Get" business is just stuff that I have to do to get the page item values into the session (so that I can pass them to the next page).
    var clickedRow = this.triggeringElement.parentNode.parentNode.parentNode;
    var ruleGroupDescr = $(clickedRow).children('td[headers="RULE_GROUP_DESCR"]').html();
    var ajaxRequest = new htmldb_Get(null, $x('pFlowId').value, null, 0); 
    gReturn = ajaxRequest.get();
    $s('P31_RULE_GROUP_DESCR', ruleGroupDescr );
    ajaxRequest = null; 
    var clearerName = $(clickedRow).children('td[headers="CLEARER_NAME"]').html();
    var ajaxRequest = new htmldb_Get(null, $x('pFlowId').value, null, 0); 
    gReturn = ajaxRequest.get();
    $s('P31_CLEARER_NAME', clearerName );
    ajaxRequest = null; 
    apex.submit("IGNORE");Finally, just create a branch to the next page and set the items on the next page to the ones on this page that are being set in the above script. Note that in my example, I have set the request to "Ignore" when I submitted; so, I set the condition of my branch to be Request = IGNORE.
    Hope this helps,
    -Joe

  • Interactive Report will not save BLOB Column Attributes

    I have created many interactive reports with 4.0 and 4.1 that had BLOB columns with no problems and the download link worked fine. After upgrading to 4.2, the interactive reports get the following error when clicking on the download link:
    Not found
    The requested URL /apex/apex_util.get_blob was not found on this server
    If I open the edit page from the report, the BLOB downloads fine. When I looked at the report attributes details for the BLOB column, I noticed the BLOB Column Attributes had not been populated. I have tried repeatedly to populate them (Table Name, Column Name, Primary Key, MIMETYPE, etc.) but after applying the changes and reopening the attributes page for the blob column, the values I entered are not saved.
    For completeness, here is the select statement for the report:
    select "DESC_ATT_ID",
    "BR_ID",
    "FILENAME",
    "MIMETYPE",
    dbms_lob.getlength("DESC_ATTACHMENT") "DESC_ATTACHMENT"
    from "#OWNER#"."ALTEC_BR_DESC_ATT"
    WHERE BR_ID = :P3_BR_ID
    Also, here is the value for the Number/Date format for the BLOB Column:
    DOWNLOAD:ALTEC_BR_DESC_ATT:DESC_ATTACHMENT:DESC_ATT_ID
    Can someone please point me in the right direction to get the link for the interactive report working properly?
    Many thanks,
    Jerry

    Hello,
    How about you do not use BLOB format Column, you do it manually as this example here:
    apex.oracle.com
    workspace: somefeto
    user: test
    pwd: test
    Application 63066
    in the same workspace, there is      Sample File Upload and Download (App ID 10540), and it is working fine ....
    Otherwise, Pls, reproduce the problem on apex.oracle.com
    Best Regards,
    Fateh
    If you believe that my answer is correct or helpful to you, then pls, mark the answer as helpful or correct

  • Interactive report: How to display "count" column on total data set?

    Hi,
    I'm a relative newbie to APEX and would appreciate some help with the following:
    I have an interactive report that will usually contain around 8000 rows.
    I need to report the total number of distinct values in one of the columns - but I need to get around the limitation of APEX where it only counts the number of rows displayed on the screen.
    I thought to create a separate region and use a separate SQL query to show the full total regardless of the number of rows displayed - however, I've now got the problem of not being able to access the interactive report "query", so, for example, if someone running the report adds a filter, I need the total to report with this new filter applied.
    Does anyone know if I can:
    a) get around the the limitation of only counting the number of rows displayed?
    or, if not,
    b) how to access the interactive report "query" that is being run?
    or
    c) any other way of doing this!?
    I do hope this makes sense. Thanks in advance for any help....
    Helen

    Hi all,
    Thanks for your responses. They really are much appreciated.
    I had hoped to spend some time on this over the weekend - but haven't got round to it. I'll work on it again tomorrow and will certainly look at the thread you mentioned Tony.
    Sorry I'm not being very clear about what I want. Why are these things always so hard to explain in words :o)
    I'll have another go....
    I have an interactive report that would report around, say, 8000 rows. Obviously I don't want to display all 8000 on the screen so I'll probably display them in chunks of 15 rows. If I use the aggregation function on the report, I can add a count of the distinct account numbers to the bottom of the display, but it will only count the ones displayed on the screen. I need the count to be of all the rows - so 8000 instead of 15 - but still displaying only 15 rows. When a user then applies a filter to the report, I need the count to change in accordance with the filter - so if the number of rows returned as a result of the filter is now 4000 instead of 8000, I need the count to now say 4000 instead of 8000 even though still only 15 rows are actually displayed on the screen.
    I'll try and pre-empt the questions...
    1) There will always be duplicate account numbers in there so the count will never be the actual number of rows - but I'm simplifying above to help explain the problem better
    2) Why would they want 8000 rows? Don't ask. I'm sure it's something to do with exporting the lot into an excel spreadsheet but they'll never admit it :o)
    I hope this makes more sense......
    Thanks again!!
    Helen
    P.S. Almost forgot again... I'm using Apex 4.1 on the Oracle hosted environment which I assume is 11g.

  • Interactive Report filtering with hidden item column names

    I have created an Interactive Report and changed some of the default column headings by using hidden Items with appropriate title. However, when I look at the filter option in the "Gear" drop-down, the only column names which appear are the default ones. There are blank lines for the columns using hidden Items. Any suggestions for having the hidden item content appear in the filter column name list?
    Thanks,
    George

    George,
    What is it you're actually trying to do here? Maybe there's an easier way?
    Hidden items aren't going to show up in the Column List.
    I'm guessing you're trying to separate a long list of column names using '----------' or something like that? We're looking to do just that in our application, but obviously we don't want to users selecting these dummy entries. We tried using the IR column groups, but those make the list look even more cluttered IMHO. (Plus setting the sort order w/in the groups doesn't seem to affect the drop-down column lists, which seems counter-intuitive to me).
    If anyone has other suggestions for breaking up the column list display, I could use something immediately (going into beta-test in 2 weeks!).
    Thanks,
    Stew

  • Contains clause in Interactive report search of a clob column

    Hi,
    I am using APEX Version 4.2.4.00.08
    How can an interactive Report use the contains clause when searching a clob column so that it uses the CONTEXT index?
    Thanks
    Chandra.

    I wrote it into the SQL used for the IR
    I created an APEX application that stores all of our IT's HOWTO documents. (word,excel,pdf)
    ctx_doc.snippet creates HTML code.
    select D.doc_id
      ,D.doc_filename
      ,dbms_lob.getLength( D.doc_blob ) as download
      ,decode( :P12_SEARCH, null, '-- nothing --',
             ctx_doc.snippet( 'IT_DATA.DOC_CTX_IX' -- my Oracle Text index name
                                 , D.doc_id, :P12_SEARCH )
       as snippet
    from it_data.documents D
    where :P12_SEARCH is null
    or contains( D.doc_blob, :P12_SEARCH ) > 0
    MK

  • Interactive Report - download to PDF, fixed column widths-- why

    We are using 4.1.1.00.23, we have just installed the Apache/FOP solution to download our Interactive Reports to PDF.
    The issue is that it seems that no matter what we do the column widths become evenly distributed in the downloaded report. When the report only has 5-8 columns this is ok, doesn't look as good as we would like but it is ok. The problem comes when we have many columns, then all of the columns get shrunk down to these little columns that become totally useless.
    Also, it appears that no matter what page size I define in the Page Attributes it sizes the columns to fit on an standard page (8.5x11).
    The question I guess is: Is there a way to download an Interactive Report to PDF, that looks exactly like the report that is displayed for the Interactive Report?
    We have been looking at lots of the documentation and fear we are missing something because it appears that most solutions talk about creating a "Shared Component" Report Query and Report Layout, which when you have a hundred interactive reports seems crazy....why can't we just download what we see on the screen.
    If there was a way to put Headers/Footers on HTML download, then we would not need to do this, but I have not found a way to do that either.

    From our understanding, it looks like we would have to create another report for each of our existing Interactive Reports, which would be a JasperReport or something.
    We know there is something with the XSL-FO templates, is that what iReports can do for us? Really this is a new world for me, so I do fear that I might be asking my question wrong.
    Like I said maybe we are missing something. We were able to get the FOP to work, but the problem with that is all of the columns are evenly distributed widths. On some reports, which have many columns, there could be a name column that needs to display 50 characters, but then the next field only has 5 characters. It appears that without creating an additional report or report layout for each report we cannot print the results of the interactive report.
    Maybe I am completely missing something in all of this, but I find it hard to believe that we have to create multiple versions of a report just to be able to print it. If we had just wanted to create a static report, then I would have continued using Oracle Reports, like we have for the last 20yrs.

  • 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

  • APEX 4 Interactive Report set font color of negative values to red

    I have an interactive report with several columns containing numerical values. If the value is negative, I want the font color to be red. Can someone help me with this process please.
    Application Express 4.1.1.00.23
    Thanks!
    Chris

    Hi,
    Use build in highlight
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/ir_using.htm#sthref1343
    Then save report default layout
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/ir_using.htm#CHDDDBCG
    Regards,
    Jari
    My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • How to use SQL*Loader to load XMLType Column with other columns?

    Hi,
    I am trying to use sqlldr to load an XML file into a table with an XMLType column. I have found plenty of examples where the entire table is an xmltype, but I would like to load many XML objects into a generic table for processing with one XMLType column and many other columns to identify the load. As a simple example, I have one constant column which I want to set during the upload.
    The following example does not work :(. No errors either.
    create table xml_upload
    (upload_type varchar2(10) not null,
    xml_data XMLType)
    my control file:
    LOAD DATA
    INFILE * append
    INTO TABLE xml_upload
    XMLType(xml_data)
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    upload_type constant MARKET,
    xml_data
    BEGINDATA
    <SALE_ORDER>
    <CUST_CODE>TIM</CUST_CODE>
    <ORDER_NUM>1234></ORDER_NUM>
    </SALE_ORDER>
    $ sqlldr my.ctl
    SQL*Loader: Release 10.2.0.4.0 - Production on Sun Sep 27 22:51:52 2009
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    Commit point reached - logical record count 4
    SQL> select * from xml_upload;
    no rows selected
    SQL>
    Any ideas on how I can do this? Am I missing something...
    I have also been playing with the lobfile clause of sqlldr, also without any success...
    Current database version is 10g R2.
    Thanks,
    Tim.

    Hi,
    I tried the same example as it is. but, I am getting the following error:
    SQL*Loader-350: Syntax error at line 6.
    Expecting valid column specification, "," or ")", found "filler".
    ,file_name  char(100) fillerThe table I created is:
      create table xml_upload
    (upload_type varchar2(10) not null,
    xml_data XMLType)The control file I used is:
    LOAD DATA
    INFILE *
    INTO TABLE xml_upload TRUNCATE
    upload_type constant 'MARKET'
    ,file_name  char(100) filler
    ,xml_data LOBFILE (file_name) TERMINATED BY EOF
    BEGINDATA
    test.xmlThe database I am using is 10gr2

  • Interactive Reports - Filter Criteria Using Other Operators

    Currently using version 3.1.2.
    Is there any way to specify the operators that are used for filter criteria on an interactive report?
    Trying to specify the following criteria...
    LASTNAME like 'B%'
    OR
    LASTNAME like 'A%'
    The interactive report uses an "AND" in this case instead of an "OR".
    Any ideas?
    Thanks,
    Kris

    Any comments would be very much appreciated.
    Many thanks

  • Interactive report, conditional display of column link

    Hello,
    We have requirement to disable editing in case that status of field is 1 (1=Closed).
    Is there any way to disable it on interactive report.
    case when status=1 column link should be disabled (not visible) in order to prevent future edits on payroll.
    SELECT payroll_no, status
    FROM hr_payroll
    ORDER BY payroll_no DESC;
    I tried link below, but it's not working in my case.
    http://nerd.net.au/24-apex-application-express/report-layout/92-conditionally-show-report-link-column-based-on-value-of-…
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    Application Express 4.2.2.00.11
    Thank you in advance,
    Regards, FM

    CASE WHEN status = 'ACTIVE' then
    <a href="f?p=&APP_ID.:60:&SESSION.::&DEBUG.::P60_EMPLOYEE_ID:'||employee_id||'"> </span><br /><span class="Moobi_Code"><img src="#WORKSPACE_IMAGES#deactivate_button.png"></a>'</span><br /><span class="Moobi_Code">ELSE NULL END deactivate_employee,
    from
    EMPLOYEES
    What exactly is the error you get? What HTML is showing in the HTML source?
    Just by looking at this I would say you need to remove the "/" in front of the f?p
    Keep in mind this way could cause problems if you start to use checksum, then you might want to look into using APEX_UTIL.PREPARE_URL to create your URL.

  • Interactive Report with Null Columns

    I've got a user who wants to export an interactive report, and he needs certain columns to appear on the export for him to fill the data in later (this is an intermediate step, while we work on getting all the data he needs in to the database). I've created the report query, and there are a handful of null/empty columns (to preserve the correct order for the export). When I try to add this query to APEX in an interactive report, I get a "ORA-00001: unique constraint (APEX_040000.WWV_FLOW_WORKSHEET_COLUMNS_UK2) violated" error.
    Googling around shows me that this happens because of similarly-named columns, and the solution is to provide aliases to all columns. My report has aliases on all columns, but I still cannot create an interactive report. I've tried changing the null columns to empty strings, as well as enclosing the aliases in double-quotes, but nothing works. I can however use my original query to create a standard report, but due to the export requirement, this isn't ideal.
    I was able to create the interactive report with one null column, and then edited the report source to add in the others. This had to be done one at a time, since trying to add multiple null columns at the same time gives the same error again. Unfortunately, when I try and run the page, I get an "ORA-20001: get_dbms_sql_cursor error ORA-00918: column ambiguously defined" error.
    My original query:
    select customer.customer_name as customer,
           project.name as project_name,       
           trunc(project.estimated_end_dt) as due_date,
           project_status.project_status_desc as status,
           null as revenue,
           project.baseline_effort as baseline_hours,
           null as projected_cost,
           null as est_gain_loss,
           project.actual_hours as actual_hours,
           project.estimated_hours as projected_hours,
           null as projected_cost,
           null as projected_gain_loss,
           null as roi      
        from project,
             customer
      where customer.customer_id = project.customer_id
      and project.inactive_ind = 0
      and project.customer_id is not null
      and project.estimated_end_dt >= :DTP_P50_STARTDT
      and project.estimated_end_dt <= :DTP_P50_ENDDT
    order by customer.customer_name,
             project.estimated_end_dt;             Can someone tell me a way to create an interactive report with multiple null columns?

    Hi shimmoril,
    The problem is likely that you have two columns aliased as "projected_cost" (7th column and 11th column).
    Hope this helps,
    John
    If you find this information useful, please mark the post "helpful" or "correct" so that others may benefit as well.*

  • Interactive Report, Link Column, Link Icon problem.....

    APEX v3.2.000.27.
    I have an interactive report and in the "Link Column" section there is a "Link Icon", if I try to substitute using one of the Columns, #IMAGETOUSE#, it does not do the substitution....
    Has anyone ever seen this happen before? It does the substitution for #IMAGE_PREFIX#, but not for any column, no matter which column I use...

    Hi,
    The subsitute #IMAGE_PREFIX# is just the path of the image stored in apex installed directory. If you are trying to access the image that you have manually uploaded try using #WORKSPACE_IMAGES#. If you have a column name "COL1" substituting #COL1# in link text will display the value of the col1 in the report and it will have the url defined in URL section.
    Thanks,
    Manish

Maybe you are looking for