Highlight SQL Report row

Not an interactive report, just a normal SQL report.
What I want, and I just can not figure it out, is have a row highlighted if columnA=0.
So, if I have 80 rows in a report, and value for columnA=0 I want that row highlighted, say a red or a yellow back ground. Can not depending on sorting as users can sort the data, columnA can be hidden or a new column added.
How would I go about doing that?

The following solution worked for me:
Re: Change color of row background when a column in that row meets a condit
Mike

Similar Messages

  • SQL Report Row Highlighting

    Hi,
    Hoping someone can please assist but I am unsure how to highlight a row within my SQL Report based on a condition, i.e. either a DECODE or CASE statement being true - if so, would like that report highlighted light blue say.
    Any help, links,examples would be much appreciated.
    Thanks.
    Tony.

    This should help
    Conditional item formatting (color)
    you will have to tweak it a bit, but its a way forward for you.

  • Report row highlight based on a page item

    Is there a way to highlight a report row based on the value of a page item?
    In my case I have a report where the application user requests data in a detail report using a column link in the master report. This loads an id number from my report into a page item (say :P8_ID for example). If this item is null, I want the report rows to all render normally (nothing is selected or the detail report has been closed). If there is an id in that field then I want the row containing the information about that item to highlight (its column link has been clicked selected it to bring up a detail report).
    At first glance, this looks similar to Vikas solution (Change the Report row color when clicked but I am trying to make the connection between what has already been done and where I need to be.

    After looking back, I discovered my value was being set after the report rendered. When I re-organized my calculations and the rest, it worked.

  • Conditional Formatting for Report Rows based on page item

    Hi,
    I have a report and a page item on a page. I would like to somehow highlight any report rows where a particular column in the report (e.g. "Customer_ID") matches the page item (e.g. P2_CUSTOMER_ID).
    Any idea how to do this?
    Thanks,
    Forrest

    You can also achieve this by jquery ( Please note - I just started learning jquery , so my way of doing it may not be a good way of doing it)
    1. Download jquery from [http://www.jquery.com]
    2. In Page Header enter
      <script type="text/javascript" src="#WORKSPACE_IMAGES#jquery.js"></script>
       <script type="text/javascript">
       $(document).ready(function(){
          //t20data is the class for table cells in theme 20 .. change it as per you theme - right click view source and find it
             x = $('.t20data').length;
         //i=7 is the column index of customer id
        // i = i + 10 , 10 is the number of column
           for( i = 7 ; i < x ; i=i + 10)
                if($('.t20data').eq( i ).html() == $x('P2_CUSTOMER_ID').value)
                    // i-7 is the first cell of row and i+2 is the last cell of row 
                    for( c = i - 7 ; c <= i + 2 ; c++)
                         $('.t20data').eq( c ).css("background","red");  
    </script>[ E X A M P L E | http://apex.oracle.com/pls/otn/f?p=62171:1]
    Regards,
    Shijesh

  • Urgent : Deleting a row in a sql report region

    Hi
    I have an SQL report, i must have an icon "delete row", when clicing this icon the row must be deleted from the report,
    what I have do but not sure of this :
    in my query I am containing some html in witch I have an icon, when the user click on this icon, I have to delete the currect row of the record
    How can I reference the currect row, and how can I clear the currect row of a report ?
    thank you

    Off course not.
    You will refer only those primary key column or composite column in your where clause. So, no matter if your table has 15 or 90 columns. All, you need to refer only those key columns in your where clause of your main query and also use them in the sub-query which is connected with IN clause.
    But, i think another approach is showing the use of exists operator. You can check that, too.
    And, in the last post Karthik has shown you the analytic approach which i prefer.
    I gave you my solution without modifying your existing sql. So, that you can understand it without a lot of hard-work and reading. ;)
    I would also request you to check the performance issue on all the solutions which have provided to you by all of us. And, you can choose the best from it after going through the explain plan details.
    So, final ball is in your court. ;)
    Take some breath - and make your wise judgment on it. :)
    Best Of Luck.
    Regards.
    Satyaki De.

  • Sql report, How to access current rows 6 columns data

    I have one page having page items & SQL report having 8 columns.
    First column of report is a link for editing.
    on clicking first column, that record gets displayed on page items, which are opn same page.
    Now my problem is i have used link column of report and set 3 page items value on click of link column.\
    But i need to set values for 2 more page items.
    I tried to create computation & process but not working. i am confused about which process point to select & whether onclick page gets submitted or not.
    I tried to write jscript but not succeeded. I dont know how to get current row id in jscript & different column values of current rowid.
    any help.

    Hi,
    Thanks for reply.
    in 5 items, first three are numeric and last two are timestamp fromtime, totime.
    as I mentioned earlier if i interchange 4 & 5 items i.e. now ITEM4 is totime & ITEM5 is fromtime
    and their values. I get value for totime & not for fromtime. all records contain values for all 5 columns. no null.
    So basically their is no problem in value or data, The only problem is whatever sequence is maintained first 4 items get value & 5th item remains blenk.
    Either I type all 5 ITEM NAMES in one Item name-value pair of link or use all three pairs, 5th ITEM remain blank.

  • How to exclude one or more rows of SQL report from sorting?

    In my SQL report I want to exclude one row from sorting. This row must be permanently at the bottom of the report.
    How to achieve this?
    Regards,
    Al

    Hi Al,
    Check out this thread: Sort within Break? I was looking to preserve a basic sort for break purposes, but the same solution should work for keeping one row at the bottom.
    Let me know if you'd like more details.
    --Jennifer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Changing Row color of standard SQL report

    Hi,
    I am trying to follow this post to change the color of a row in APEX SQL report. Change Colour of Row - Oracle APEX SQL Report
    It's a bit outdated, and trying to figure out how to get to this page: http://img7.imageshack.us/img7/4782/columntemplate.jpg in APEX 4.2 where I can conditionally set background color.
    I am using theme 13 (legacy) and made a copy of the report region. Edited it but cannot find an equivalent section of that apex 3.1 screenshot.
    Any help appreciated.

    William Wallace wrote:
    I sure was :) Cheers for pointing it out.
    Just another question, there are 4 options for the #COLUMN_VALUE# which I have background color conditionally (just like in that screenshot) based on one of the column values. The column can be of 1..5 values, however I only have 4 conditions to work with in the template editor.
    So what APEX is doing is since it can't find a 5th matching condition, it picks the very first one and applies it on it (even though the condition doesn't match).
    Is there anyway I can incorporate a 5th option/condition for column templates? Cheers.Not using that technique. There are a couple of options: another template-based approach using a custom named column report template, or using jQuery. I generally prefer the template method as everything runs on the server.
    1. Start by including a column containing the condition logic to generate a class value in the report query:
    select
            , case
                when sal < 1000 then 'low'
                when sal between 1000 and 2000 then 'medium'
                when sal > 2000 then 'high'
              end sal_class
    from
              empThen create a custom named column report template:
    2. Go to: Shared Components > Templates > Create
    3. In the wizard select: Report > From Scratch
    4. Enter/select:
    Name: [Name for this template]
    Theme: [Your current theme]
    Template Class: Custom 1
    Template Type: Named Column (row template)
    5. Click Create.
    6. Click the Status Report link in the Templates report.
    7. Enter the following properties:
    Row Template 1
    <tr class="#SAL_CLASS#"><td>#1#</td><td>#2#</td>...include a cell with a column substitution for every column in your report...</tr>i.e. the column with the conditional logic in the query is used to apply the required class to the row.
    Before Rows
    <!-- Copy the Before Rows definition from the Standard report template for your current theme and paste here -->
    <tr><th>#1#</th><th>#2#</th>...include a header with a column substitution for every column in your report...</tr>
    After Rows
    <!-- Copy the After Rows definition from the Standard report template for your current theme and paste here -->Add CSS to style the rows:
    8. Edit the Page CSS Attributes for the report page:
    Inline
    tr.low td { background-color: yellow; }
    tr.medium td { background-color: white; }
    tr.high td { background-color: red; }9. Change the report to use the new template.
    For the alternative jQuery approach, Tom created an example for this thread: +{thread:id=2487955}+

  • Multi row update in sql Report

    Hi All,
    I had created a Updatable SQL report , and the SQL query fetches data from four table and JOIN condition also exists.
    Currently I can Update only one row at a time but what I want is to update multiple row at same time. Is this possible without TABULAR FORM ?
    Thanks
    Dikshit

    Hi
    The whole concept of a Tabular form is that it shows a table of updatable rows. These can be modified and then when the user clicks "Update" all the rows that have been changed will be updated on the base tables.
    There is no wizard to do this any other way. However there is something in APEX called htmldb collections. These are essentially virtual tables that can hold data temporarily in memory. You could consider using a form to update each record individually, then when the user clicks "Save" it writes the updated form data to an htmldb collection. The user could then click "Update All" and all the data in the htmldb collection could be updated on the base tables.
    htmldb collections are well documented in the HTMLDB Users Guide.
    I hope this helps,
    Cj

  • Highlighting currently selected row in a Report-Form page

    Hi,
    I have a page with Report - Form layout. On the top of the page there is a classical report (not IR). When the user click a row then I display a detail form below it. It would be nice if I could highlight the row the user clicked last time, to indicate to which row the detail data below the report belongs to. Did any body do something similar?
    Regards, Tamas

    It's relatively simple to achieve this&mdash;without JavaScript&mdash;using a named column report template and CSS:
    http://apex.oracle.com/pls/apex/f?p=34839:27:0
    We'll assume a page item (or items) already exists for receiving the master row primary key value(s). In the example this is P27_DEPTNO. Give the master report region a static ID for use in CSS selectors. Here this is department.
    If the master primary key value(s) are used as links in the report, then [column link] columns need to be created to replace them in the report attributes.
    Create a named column report template as required by your report query, including an HTML ID attribute for the report row element that contains column references to the primary key value(s). Replace column references in the row template for any primary key link columns with the [column link]s created previously. In the example, [column link] (ref #4#) replaces DEPTNO (ref #1#) as we need to reference the original DEPTNO value in the row ID:
    Row Template
    <tr id="dept-#1#">
      <td class="t17data">#4#</td>
      <td class="t17data">#2#</td>
      <td class="t17data">#3#</td>
    </tr>We then just need to use the selected P27_DEPTNO value via substitution in a page HTML Header to create a descendant selector that will apply a highlight to the cells in the currently selected row (along with some others to make it easier to select the row):
    CSS
    <style type="text/css">
    /* Make the whole table cell a link target */
    #department td {
      padding: 0;
    #department td a:link {
      display: block;
      padding: 2px 8px;
    /* Universal Selector sucks */
      font-size: 9pt;
    /* Highlight the selected row */
    #department tr#dept-&P27_DEPTNO. td {
      background-color: #eee;
    </style>

  • SQL Report - PDF Report Printing. How to show one row per page?

    Hello
    I have successfully created a simple SQL Report.
    Than I enabled Report Printing to PDF (default Report Layout).
    Export to PDF is working good by default.
    Now I want to see one report row per one PDF page. Is it possible?
    How I can change the amount of rows per PDF page using default report layout?
    I tried to create a User Layout with MSWord Plugin. it's quite suitable for data forms.
    But I still did not find a way around for my question.

    I would create an User Layout (.rtf) with MSWord. Load your XML data and use the table wizzard to put the fields in your document.
    Put this code after your last field and before the 'E' (= <?end for-each?> tag):
    <?split-by-page-break:?>

  • Highlight an item in a SQL-report

    Hello,
    I have a table in which items are stored with a column "name" and a column "correct".
    I need to highlight an item (put backgroundcolor in red) in a SQL-report based on the fact if the value of the column "correct" of the item is False. I don't know how I can do this? Can anyone help?
    Thanks in advance,
    Bram.

    Hello Bram,
    Something like:
    select "DEMO_PRODUCT_INFO"."PRODUCT_ID" as "PRODUCT_ID",
          CASE WHEN PRODUCT_AVAIL='N'
             THEN '<span style="background:red">'||product_name||'</span>'
             ELSE product_name
             END  "PRODUCT_NAME",
          "DEMO_PRODUCT_INFO"."PRODUCT_AVAIL" as "PRODUCT_AVAIL"
    from "DEMO_PRODUCT_INFO" "DEMO_PRODUCT_INFO"Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Loop Through Rows in SQL Report.

    Hello Everyone,
    I've been creating a very different application, and I've run into quite the roadblock.
    Let me give you a breif about the problem.
    I have a form that needs to be dynamic and thus is created at runtime.
    I have used the APEX_ITEM and a SQL SELECT CASE to create a dynamic report.
    For example if the DATATYPE column in my table says DATE, I create an APEX_ITEM.DATE_POPUP, if it says CHAR i create a textbox, and if a column called
    LOV is populated APEX_ITEM.SELECT_LIST_FROM_QUERY using the number value of the LOV to query a List of Values from another table.
    Now this brings me to say in a single column of the there could be different data_types. meaning the multi-row update functionality with apex will not work.
    Getting the data to display is easy. However saving the updates is a different story.
    Which brings me to my question. Does anybody know of way in which you can loop through each row in a SQL Report on APEX and assess each row individually.
    I'd like to accomplish something like this
    LOOP
    MyUpdateProcedure(currentrow_id,currentrow_datatype, currentrow_value)
    Go to Next Row in Report
    END LOOP;
    Pretty simple in theory? Do we have an APEX expert out there who could give me a hand with this?

    Codes,
    It sounds to me like you could add a hidden field to tell you what you need to know in order to determine the column to update.
    Assuming it was created using the parameter p_idx = 50 and contained the names you provided (eg DATA_DATA) and your primary key is created using p_idx = 1 then you could add the logic for the update into an on submit process something like so
    FOR i IN 1 .. apex_application.g_f01.COUNT
    LOOP
    CASE apex_application.g_f50(i)
    WHEN 'DATA_DATA' THEN
    -- run the update against the data column
    WHEN 'CHAR_DATA' THEN
    -- run the update against the char column
    etc.
    If the multi-type column is created with the apex_item api using p_idx = 2 then you just refer to it in the loop as apex_application.g_f02(i) and the primary key is apex_application.g_f01(i).
    I hope this helps.
    Greg

  • Color report rows based on a value in that row

    I would like to Color report rows based on a value in that row.
    For examplle with the "EMP" table:
    I would like job=MANAGER to be red and job=CLERK to be green etc etc
    The other example I found only had the option of one color either the highlight or the default color.
    I am looking for a way to do multiple colors.

    Hi,
    In the row template, you can use #1#, #2#, etc to indicate where a field in the report needs to be output. This does not have to be plain text - ie, you can use it within style tags if you like.
    So, take a query like:
    SELECT EMPNO,
    ENAME,
    DEPTNO,
    DECODE(DEPTNO, 10, 'green', 20, 'red', 30, 'cyan', 'white') BG_COLOUR
    FROM EMPYou get columns 1=empno, 2=ename, 3=deptno and 4=bg_colour. In the row template, you can then do:
    Before Rows setting (sets up the table):
    &lt;table&gt;
    &lt;tr&gt;&lt;td&gt;ID&lt;/td&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;Dept&lt;/td&gt;&lt;/tr&gt;After Rows setting (closes the table):
    &lt;/table&gt;Row Template 1 (used for ALL rows):
    &lt;tr style="background-color:#4#;"&gt;&lt;td&gt;#1#&lt;/td&gt;&lt;td&gt;#2#&lt;/td&gt;&lt;td&gt;#3#&lt;/td&gt;&lt;/tr&gt;Then, for every row, the colour that has been calculated using the DECODE function will be used in the style tag to colour the background for the entire row.
    How you determine the colours is up to you. I've used DECODE here, but you could use a field on the DEPT table to hold this and use this in your SQL statement.
    Andy

  • Highlight every alternate row

    Hi,
    I have 2 queries, one for master and one for detail linked.
    In my paper layout, for my detail group I need to highlight every alternate row.
    I tried with creating a summary column in detail group
    and assigned formula as 'count' and selected reset group as the detail group, but i don't know what to assign for the source.
    also help me how the formatting trigger goes.
    thanks
    asha

    Hi Asha,
    There may be several ways to achieve this - "to highlight every alternate row" in your detail group.
    Here is just one example that I have tested - based on 2 linked queries (1 master and 1 detail).
    In your detail query, add the following column:
    mod(rownum,2)"Seq"
    to your SQL statement.
    This will give you values of 0 or 1 for alternate rows. ie row 1 "seq" will have a value of 1 and row 2 will have a value of 0, etc. This column does not need to be displayed in the layout.
    Now, you can add the following format trigger for each of the columns in the detail group:
    begin
    -- Automatically Generated from Report Builder.
    if (:mod_rownum_2 = '0')
    then
    srw.set_foreground_fill_color('red');
    srw.set_fill_pattern('solid');
    end if;
    return (TRUE);
    end;
    The above code was generated by using conditional formatting, setting the colour to "red".
    Hope the above helps.
    Regards,
    John

Maybe you are looking for