Classic report - Highlight row

APEX 4.2.1
With all the latest and greatest dynamic action and jQuery goodness in 4.2.1, what is the easiest, declarative way to highlight rows in a classic report region (Generic Column Template) based on data condition using values on the row, using #COL# notation? e.g. If SAL > 1000 and DEPT = Marketing, highlight row in red or some such.
In prior versions, this involved copying the Generic Column Template to one used just by this report and use the (up to 4) Column Templates with a PL/SQL expression.
Thanks

Custom report templates are okay if your needs are straightforward. But you said it already, there are only four different flavors to chose from.
Here is a solution that'll work on all pages if once installed and can be extended to a multitude of visual attributes. Only an example that you may want to adapt to your liking.
Edit Page, "CSS, Inline", or via Shared Components > CSS files
td.color1 {background-color:#9F9} /* Table cell gets colored in light green  */
td.color2 {background-color:#FF9} /* Table cell gets colored in light yellow */
td.color3 {background-color:#F99} /* Table cell gets colored in light red    */
/** and so forth, followed by as many declarations as you need... */Page Template, "Function and Global Variable Declaration":
/** Change the visual appearance of your classic report as you like after it's rendered */
function customClassicReportDisplay(){
  /** Transfer the color class from the text to the table cell */
  $('td span.color1').closest('td').addClass('color1');
  $('td span.color2').closest('td').addClass('color2');
  $('td span.color3').closest('td').addClass('color3');
  // and so forth, followed by as many declarations as you need...
}This jQuery code can be simplified, especially the handling of many lines for many colors can still be compacted, which makes it more difficult to understand though.
Page Template, "Execute when Page Loads":
/** Perform the function on Page Load */
customClassicReportDisplay();
/** Perform the function after Partial Page Rendering */
$('form').bind('apexafterrefresh', function(){
  customClassicReportDisplay();
});Here comes the trick. In the SQL statement, you wrap a <span> HTML tag with a different class declaration around each value that you want to color.
SELECT '<span class="color' || case when some_value > 100 then '2' else null end || '">' || some_value       || '</span>' AS some_value
     , '<span class="color' || decode(some_other_value, 'too much', '3', NULL)   || '">' || some_other_value || '</span>' AS some_other_value
     , '<span class="color' || case when last_value between  0 and  10 then '1'
                                    when last_value between 11 and  50 then '2'
                                    when last_value between 51 and 100 then '3'
                                    else null end                                || '">' || last_value       || '</span>' AS last_value
  FROM ...This obviously makes the SQL a bit more complicated but in my opinion, I think this is a data driven topic and therefore just fine. Hence you say "depending on value ranges I want to change something" - and that belongs to SQL. WHAT you want to do (here: change color) is then up to your JS and CSS declaration. If you shift the SQL code into a view it's better to maintain and won't get spoiled by non-savvy third party developers...
I know that's not what you originally asked for, because there is no #COL# notation, but for me it's the most flexible solution I can think of under APEX.

Similar Messages

  • How to put checkbox into classical report header row?

    Hi,
    I have a classical report that has a check item as a first column. I would like to put a check box item into the header row too, When checked it is supposed to set the check box item in all report rows. Something like in APEX Shared components / Links / Grid Edit.
    Is this possible to do? TIA.
    Tamas

    Hi,
    See e.g. this post
    Re: Tabular form check all checkbox header
    Regards,
    Jari

  • Left Group style report highlight row issue

    I have a Left group style report that I need rows highlighted for sub-total lines in the report. I have coded it with the following in a fiield after the for each of the report
    <?if@row:PERF_NON_PERF='Sub-Total'?><xsl:attribute name="background-color" xdofo:ctx="incontext">yellow</xsl:attribute><?end if?>It highlights MOST of the row but ends up missing the last few columns. The page setup has been set to landscape to maximize the amount of data being displayed.
    I can send along sample data and rtf file if needed, just seems rather... Weird...
    Any help would be welcome..
    Thank you,
    Tony Miller
    Dallas, TX

    Bump.. Anybody have an idea on how to have highlight for entire row of a landscape based report?
    Thank you,
    Tony Miller
    Dallas, TX

  • Classic Report with a two-line row, the second one as a drop down?

    Hi,
    Using APEX 4.0 is it possible to make a classic report layout that has row items sorted in 2 rows? The first row for each SQL record set row looks like the classic report 'normal' row, while the second one contains just one single column value. This second row is supposed to be hidden and should be displayable by clicking a small '+' sign at the beginning of the row.
    I remember having seen this done, but I simply seem not to be able to formulate my query correctly to let Google display me the expected result. Although I am not sure if was APEX+jQuery or ExtJs. I hope though it is not ExtJS, since I do not plan to use that one.
    Thank you in advance.
    Tamas

    Is this for Verizon landline internet? If so, you should ask your question in the Verizon Residential forums. http://forums.verizon.com

  • Highlight  a row in classic report based on condition

    HI all Gurus
    Using Apex 4.1.1 oracle 11g linux oc4j
    I want to highlight a row where #column_value#='Y' to grey  keep others as normal report settings.
    I have a simple sql query
    SELECT PK_ID,
      FIRST_NAME,
      LAST_NAME,
      INITIAL_REG_DATE,
      MAIL_DATE,
      BEGIN_DATE,
      END_DATE,
      END_DATE-BEGIN_DATE as "#days",
      BEGIN_STATUS,
      END_STATUS, 
      COMMENTS,
      DELETE_FLAG,
    case when  DELETE_FLAG='Y' then 'GREY' else '#f0f0f0' end  DELETE_FLAG ,
    INITIAL_REG_DATE+(END_DATE-BEGIN_DATE) "New Reg end date"
    FROM SOR_TRACKING_DEL
    where pk2_id =:P216_Detail
    order by mail_Date desc
    I created a Dynamic action
    which will fir on on load , BIND on this classic report
    $("input[name=f29]").each(function(){ 
    var lThis=$(this); 
    if(lThis.is("Y")){ 
      lThis.parents("tr:eq(0)").children("td").css({"background-color":"GREY"}); 
    } else { 
      lThis.parents("tr:eq(0)").children("td").css({"background-color":"#f0f0f0"}); 
    But this is not changing color as expected..
    Kindly help me !
    Thanks

    Scott and Tom
    Thanks you guys for looking into this.
    Pls ignore my improper explanation and my inexperience with jquery.
    I read some blog and was trying to do same on classic report but all blogs I found so far referred either interactive report or tabular report none of them mentioned classic report.
    I guess using array for classic report wont be a good idea to start with. :/
    I am not sure if this is right syntax and logic to highlight the row
    $(function(){
    var DELETE_FLAG = $(this);
        if DELETE_FLAG.is("Y"))
      DELETE_FLAG.parents("tr").children("td").css({"background-color":"GREY"});
    I also created app here
    http://apex.oracle.com/pls/apex/f?p=35155
    workspace sors
    user tester/testing
    application 35155
    Thanks again.

  • Classic report - Condition evaluated for every row

    APEX 4.2.2
    I am seeing something strange in a classic report region. A report started to fail at run-time with a strange error about bad syntax. When I run the page in debug mode, I see the following
    print column headings
    rows loop: 30 row(s)
    ...Execute Statement: begin wwv_flow.g_boolean := '' is not null;
    end;
    ......Result = false
    ...Execute Statement: begin wwv_flow.g_boolean := '' is not null;
    end;
    ......Result = false
    ...Execute Statement: begin wwv_flow.g_boolean := 'string with a embedded ' single quote' is not null;
    end;
    ......Result = true
    Looks like the APEX engine is evaluating a boolean expression after rendering and each and every row in the report. And for some strange reason, it is using a piece of data from my query's resultset and failing because of the bad syntax introduced due to the single-quote in the string.
    I have never seen this before. Any idea what is going on?
    Thanks

    Howdy Paul, sorry should have provided all the details. No, this is a standard generic column template. Ah, you are right, drat I should have looked closer. The template has use a condition to show either a highlighted row or normal one. Sorry for the false alarm, I can take it from here. Enjoy your flight :-)

  • Whole row of classic report clickable

    Good morning,
    I tried this solution to make a whole row in a classic report clickable:
    {message:id=9656396}
    It worked pretty well but I only on the first open page of a multi page report. If I go to the next or previous page the rows are not clickable anymore. I tried to use livequery but ended up with clickable rows on every second page:
    The report loads with clickable rows. First time I click 'next' the rows are not clickable, second time they are clickable again and so on.
    My livequery statment looks like this:
    $(document).ready(function()
      $('table tr .myClass td').livequery(function(){
        $(this).css("cursor","pointer");
        return false;
    });Can anyone please give me a hint what I'm doing wrong here and how to solve my Problem?
    Cheers,
    Andreas
    PS: How can I format the sourcecode in this forum?
    edit: format

    Hi,
    you can use the following (here I assume the template uses <tr #HIGHLIGHT_ROW#>) :
    CSS :
    tr.highlight-row td:hover {
         cursor:pointer;
    JQuery :
    $('#your_report_id').delegate('tr.highlight-row', 'click', function () {
         do_what_you_want_on_row_click();
    });

  • Highligh current row not working for classic report in 4.1

    Hello experts,
    One of our customers is migrating applications from APEX 3.0 to 4.1.
    All their applications use classic reports because interactive reports didn't exist in 3.0.
    The end users of the applications like the row color changing when they hover there mouse over the rows (highlight current row) and they insist on keeping this "functionality" in the applications.
    For some reason, this "functionality" doesn't work anymore after the migration to APEX 4.1.
    I thought it was something theme related so I created a new application with a classic report, tried some APEX built-in themes, and with none of them, I manage to get the highlight current row working.
    For interactive reports it is not an issue.
    Is this an undocumented no-longer-available feature of APEX 4.x or has there changed something which caused this functionality to stop working??
    Regards,
    Bart

    Hi,
    I created a service request for this issue, and the support analyst that helped me confirmed that this is a bug:
    "I have created the bug :
    Bug 13584762 - ROW HIGHLIGHTING NO MORE WORKS IN CLASSIC REPORT IN APEX 4.1
    While working on the problem , I have found the following solution in order to make the Row HighLightng work in APEX 4.1
    In the apex_4_1.min.js (file located in images\javascript ) , Search for :
    function setRowHighlight(a){apex.jQuery("#report_"+a+" .highlight-row").live("hover",function(b)
    and replace "hover" by "mouseover mouseout" :
    After the modification :
    function setRowHighlight(a){apex.jQuery("#report_"+a+" .highlight-row").live("mouseover mouseout",function(b)
    A refresh in the browser may be necessary in order to "reload" the file apex_4_1.min.js"
    I implemented the suggested workaround and this solved the problem!
    HTH,
    Matthias Hoys

  • How to set the number of rows displayed in a classical report at runtime?

    Hi,
    Our customer has several standard client hardware configuration and would like to enable end users to choose their 'display profile' at login time. This 'display profile' would contain predefined values for these hardware configurations and supposed to set various paramters that should define the number of rows displayed in a classical report region.
    I tried to provide parameters on the report region but it refused to accept anything but numerical values. Is it possible to do this?
    Regards, Tamas

    The link is to the closest linkable point in the documentation to the description of the Number of Rows (Item) attribute.
    It sounds like you have been trying to enter&mdash;unsuccessfully&mdash;an item name or substitution string into the Number of Rows attribute. The Number of Rows (Item) attribute is the one that actually allows you to do this. Click on the flashlight icon beside it to get a list of items from the application.

  • Going back to same row after saving changes in classic report

    dear all,
    I have a long classic report .User is able to update different rows of this report using MR update process.Now user is asking for easier flow.What he wants is to be able to go back to same row after he saves the changes.How is it possible to do so
    Thank you so much,
    Zahra

    Hi,
    I have one sample
    https://apex.oracle.com/pls/apex/f?p=40323:40
    When you change Active column select list, page is submitted. After submit JavaScript scrolls report
    See this post about details
    HELP TABULAR FORM CURSOR FOCUS
    Regards,
    Jari

  • Getting selected row values of a classic report

    Hi Guys,
    i'm using Apex 4.1,
    I have a classic report on my apex page. First column of this report is check box for row selection. and its binded to primary key of a table. i know that i can get the selected row's primary key (Check box value) using APPLICATION_ITEM.G_FO1() function. What i need is how can i get the other cell values of the selected row ?
    Appreciate if someone can help on this,
    Thanks.

    Apex-Ape wrote:
    i'm using Apex 4.1,
    I have a classic report on my apex page. First column of this report is check box for row selection. and its binded to primary key of a table. i know that i can get the selected row's primary key (Check box value) using APPLICATION_ITEM.G_FO1() function. What i need is how can i get the other cell values of the selected row ?If you really have a report with just one checkbox column and the rest of the data standard read-only report columns then it's not clear exactly what the requirement is. What do you want to do with them when you get them?
    I can think of 2 possible approaches:
    <li>Stick with the current report. On page submit you get an array of zero or more PKs. Create a collection with a row containing each PK. Whatever it is that you want to do next can then use a query that is a clone of the original report query plus a join to the PK values in the collection.
    <li>Recreate the report with shadow <tt>apex_item.hidden</tt> columns in the query for each value. In the report column attributes, do not display the <tt>apex_item.hidden</tt> columns, but include them with each displayed column (or stuff them all into one column for convenience) using HTML Expressions. The values will then be available in <tt>apex_application.g_fxx</tt> arrays like the row selector checkbox.
    I prefer the first one, but really it depends on what the next step is...
    (If it's actually a tabular form then the values will be in other <tt>apex_application.g_fxx</tt> arrays.)

  • Adding the Checkbox for each row in classic report

    Hello,
    I have created classic report with checkboxes in each row and added the On-Submit process, BUTTON CONDITIONAL, to determine the behavior of the checkboxes. The PL/SQL process is suppose to delete the selected row from database.
    I am getting the Success message, but When I check the database, the row still persist in the database.
    PLSQL CODE:
    FOR i IN 1..apex_application.g_f01.count LOOP
    DELETE 
    FROM
      registry 
    WHERE
      reg_id = apex_application.g_f01(i);END LOOP;
    ORACLE APEX: 4.2
    Thank you

    Hi ApexNewLearner,
    Try this
    DECLARE
    j number;
    BEGIN
    FOR i IN 1..apex_application.g_f01.count LOOP
      j := apex_application.g_f01(i);
      DELETE FROM  registry
      WHERE  reg_id = apex_application.g_f01(j);
    END LOOP;
    END;
    or better try to replicate your issue on apex.oracle.com , that is easy for users to investigate the issue and give you appropriate solution.
    Hope this helps you,
    Regards,
    Jitendra

  • How to delete multiple row in classic report.

    Dear Friends,
    i am using 4.1 ve.
    i have created classic report.i want to delete row .
    How can i do it.
    i need check box in classic report and if i select multiple check box then row should delete and before delete pop up should be pop up to confirmation to delete.
    How can i do it.
    Thanks

    Hi Vedant,
    here you have one advanced example:
    http://www.talkapex.com/2009/01/apex-report-with-checkboxes-advanced.html
    But you can do it easier using only apex_item.checkbox (creating one column in report query with this function).
    After you submit this page the value will be stored to apex_application.g_f0X variable where X is equal to p_idx param of function apex_item.checkbox.
    Note: only checked values will be stored.
    Br,
    Marko Goricki
    http://apexbyg.blogspot.com

  • Classic Report limit the number of rows displayed

    Hi All,
    In my application I have a classic Report which show the data of a simple query. For lay-out reasons I want to limit the number of display to 5 instead of the default 15. I've looked in several forums and they told me that I have to set the number of rows in the report attributes.
    But it did not what I want. I'm Using APEX 4.1.0 on a Oracle 11G database
    My question is: How can I limit the maximum number of rows in a classic SQL Report.

    Hamertje16 wrote:
    In my application I have a classic Report which show the data of a simple query. For lay-out reasons I want to limit the number of display to 5 instead of the default 15. I've looked in several forums and they told me that I have to set the number of rows in the report attributes.And did you do so?
    But it did not what I want. I'm Using APEX 4.1.0 on a Oracle 11G databaseHow did it not do what you want? Displayed an error? Displayed no rows? Displayed 15 rows? Displayed some other number of rows? We can only help if we fully understand the nature of the problem.
    My question is: How can I limit the maximum number of rows in a classic SQL Report.To display 5 rows per page set the report's Number of Rows attribute to *5*.
    However, pagination settings get cached for the duration of the session. For this change to be instantly visible, either log out, restart the brower, and log in again, or manually re-request the page from the browser address bar, adding 'RP' in the ClearCache position in the URL.

  • Highlight row in standard report based on value in column...

    I am trying to highlight rows of a standard report based on the value of the column TICKET_TYPE.
    I have been following the post: Highlighting a ROw in a tablular form based on a column in the row
    but having difficulty. I receive the following error:
    ORA-06550: line 1, column 34: PLS-00201: identifier 'SHRIMP' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored
    ERR-1025 Error processing PLSQL expression. SHRIMP = 'SHRIMP'
    My report query is:
    select T.TRIP_ID,
    T.TRIP_ID trip_show,
    T.TRIP_ID trip_select,
    T.DAYS_AT_SEA,
    T.NBR_OF_CREW,
    T.TRIP_START_DATE,
    T.VESSEL_ID,
    o.ticket_type ticket_type
    from TRIPS T, one_ticket_type o
    where t.dea_permit_id = :G_DEA_PERMIT_ID and t.trip_id = o.trip_id
    I have created a new template called one-ticket-highlight.
    row tempate 1 = <td #ALIGNMENT# headers="#COLUMN_HEADER#" class="t14data" style="background:red">#COLUMN_VALUE#</td>
    row template 1 condition = use based on pl/sql expression
    row template 1 expression = #TICKET_TYPE# = 'SHRIMP' (**** I have also tried without the quote)
    any thoughts? thanks!!
    Edited by: KEH813 on May 25, 2010 11:10 AM

    Hi,
    You can achive the same using javascript without changing the page template.
    http://apex.oracle.com/pls/apex/f?p=27576:8
    here is the code for the same
    <style>
    .myclass{ background-color:red;text-align:center}
    </style>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js "></script>
    <script>
    $(function(){
       $("td [headers='DEPTNO']").each( function(i){
           if($(this).html() == $v('P8_DEPTNO'))  //value of the textfield
               ele = $("td [headers='ENAME']").eq(i)
               ele.removeClass('t20data');   //i'm using theme 20 so t20data .. u need to change this part
               ele.addClass('myclass');
    </script>Regards,
    Shijesh

Maybe you are looking for

  • Cloud subscription re-install on new computer. old computer is dead

    Cloud subscription re-install on new computer. old computer is dead

  • Form help with Dreamweaver

    Hi there I have a form on a webpage that I have altered that works fine when submitted ..however there are 2 fields that don't show up in the received email ..The boy/girl radio button selection and the Related Radio button group (6 selections) Can a

  • Can I hyperlink text to open an email in Apple Mail?

    Hi, Are there the equivalent of URLs for mail in apple mail?  I'd like to click on a link in say a Word document, that would immediately open up a related email, but I can't find out how to get the URL (or whatever it might be called) for an email wh

  • Dashboards - More than one level deep

    Is there a way to create a Dashboards more than one-level deep. Currently I can put a Dashboard within another Dashboard (Getting the flyout menu when I select the top-level dashboard in the Interface). However, what if I want to go one level deeper?

  • Vendor return with 122mvt type

    All, Please see the scenario below : Now one  raw material 'x' are in Rejection SLoc ( S Loc name ). The status of that stock is 'blocked' . 1.Now without changing the status whether we can remove the material     from that S Loc ? 2. I need to retur