State of color lines based on a value in the same row

I would like to color report lines based on a value in the same row.

For bolting with the table 'EMP ':

I would like job = MANAGER and Red work = CLERK to be green etc etc.

The other example I found was the possibility of a single color either the nail or the default color.

I'm looking for a way to do multiple colors.

Hello

In the model line, you can use #1 #, 2 # #, etc. to indicate where a field in the report should be released. It doesn't have to be clear - that is to say, you can use it in style tags if you wish.

So take a query such as:

SELECT EMPNO,
ENAME,
DEPTNO,
DECODE(DEPTNO, 10, 'green', 20, 'red', 30, 'cyan', 'white') BG_COLOUR
FROM EMP

You get the column 1 = empno, 2 = ename, 3 = deptno and 4 = bg_colour. In the model line, you can then do:

Before defining lines (implements the table):

<table>
<tr><td>ID</td><td>Name</td><td>Dept</td></tr>

After setting (farm table) lines:

</table>

Model 1 (used for all lines) line:

<tr style="background-color:#4#;"><td>#1#</td><td>#2#</td><td>#3#</td></tr>

Then, for each row, the color that has been calculated by using the DECODE function is used in the style tag for color the background of the whole line.

How to determine the colors, it's you. I used DECODE here, but you can use a field on the DEPT table to hold and use it in your SQL statement.

Andy

Tags: Database

Similar Questions

  • Hide a field value based on the value of the previous row

    I need to read the string before the underscore (_) and show that the value in the 1st row for the field of Value1. For example, if the previous string (ABCDE) is equal to that of the second line I need to hide the value (100) on the field of the value1.

    Sample data:

    Report IDVal1Val2Val3
    ABCDE_01100200300
    ABCDE_02100250350
    XYZ5006028

    Final results:

    Report IDValue1Value2Value3
    ABCDE_01100200300
    ABCDE_02250350
    XYZ5006028

    I am using code below but error.

    <? If: xdoxslt:get_variable($_XDOCTX,_'x')! = substr (REPORT_ID, 0, instr(REPORT_ID, '_', 0) - 1)? >

    <? Value1? >

    <? end if? >

    <? xdoxslt:set_variable ($_XDOCTX, 'x', substr (REPORT_ID, 0, (instr(REPORT_ID, '_', 0)-1)))? >

    You can use this condition instead:

    It will manage both of your cases.

  • Looping through the names of columns that are based on a value of the variable

    I have an ArrayCollection collection with a series of columns named price1, price2... through price10

    I try through these columns based on a value of the loop variable, but may not understand the syntax:

    for (var column: int = 1; column < 11; column ++) {}
    testPrice = myGrid.selectedItem.price (column); <-this does not work
    }

    Try testPrice = myGrid.selectedItem ["price" + column];

    Don't forget to test this selectedItem is not null before you try to set the values.

    TS

  • Multiple values for the same column in the columns of diffétent in the same row?

    Hi all
    I wonder how you can display different values for the same column in different columns on the same line. For example, using a CASE statement, I can:

    CASE WHEN CODE IN ('1 ', ' 3') THEN COUNT (ID) AS 'Y '.
    CASE WHEN CODE NOT IN ('1 ', am') THEN COUNT (ID) AS "N".

    Yes, that will produce two columns but will produce null values to empty and also two separate registers.


    Any ideas?

    Thank you

    Are you sure that this code works for you?

    Select ID
             ,CASE WHEN MODE_CODE IN ('1', '3') THEN COUNT( No) END as "Fulltime"
             ,CASE WHEN MODE_CODE NOT IN ('1', '3') THEN COUNT( No ) END  as "Other"
    From table
    group by ID
    

    I guess the code above fails because MODE_CODE is not in your group by?

    My suggestion would be to put the CASE in the COUNT:

    Select ID
             ,COUNT(CASE WHEN MODE_CODE IN ('1', '3') THEN No END) as "Fulltime"
             ,COUNT(CASE WHEN MODE_CODE NOT IN ('1', '3') THEN No END)  as "Other"
    From table
    group by ID
    

    CASE expressions return no. when the respective conditions are true and NULL otherwise.
    COUNTY will have non-null values.

  • Sum of the values of the previous rows in a PivotTable

    Hello

    I have a dynamic table has several lines (dynamically added via a button).  A column in the table is a quantity column.  Another is a Total of the column.  We do not keep a cumulative, but wants to only display an total when the rest of the cells in the same row are emty and the previous lines has / have values in the quantity column.  The Total is the sum on the Quatnities until a blank line.  Here is a sample.  How can I get the value of the quantities in the previous lines?

    Quantity Total


    5
    8
    12

    25


    7
    27

    34


    22

    22


    Another option could be to put the Total in the last row with data as opposed to the line below the data.

    Any ideas?

    Kind regards

    Karl

    The script is written to achieve your requirement (i.e. the second approach you mentioned)

    .

    You can either contact me at [email protected] for the example of created form.

    Or what follows is the Source XML of the form. Copy all the content in your form XML source mode and see the result.

    http://ns.Adobe.com/XDP/"timeStamp =" "2012-02 - 28 T 14: 04:54Z ' uuid ="2c561cdf-3377-4e84-9a89-51e740bb2fea">"

    Adding line

    Quantity

    Total

    user interface

    >

    character = "Myriad Pro

    "/>

    margin = topInset ' 1 mm ' bottomInset = ' 1 mm ' leftInset = ' 1 mm ' rightInset = ' 1 mm»

    "/>

    para vAlign = "middle".

    "/>

    border

    >

    edge

    />

    angle thickness = "0,1778 mm

    "/>

    border

    >

    field

    >

    = "Total" field name "44.47 mm" h = w = "9,317 mm" access = "readOnly".

    ">

    user interface

    >

    numericEdit

    >

    presence at the border = "hidden".

    ">

    border

    >

    the margin of

    />

    numericEdit

    >

    user interface

    >

    character = "Myriad Pro

    "/>

    margin = topInset ' 1 mm ' bottomInset = ' 1 mm ' leftInset = ' 1 mm ' rightInset = ' 1 mm»

    "/>

    this.rawValue = null; Clear the total value

    }

    } catch (e)

    {

    app.alert (e)

    }

    9.0.0.0.20091029.1.612548.606130

    http://www.XFA.org/schema/XCI/2.8/">

    PDF

    1.7

    3

    *

    http://www.XFA.org/schema/XFA-locale-set/2.7/">

    January

    February

    March

    April

    May

    June

    July

    August

    September

    October

    November

    December

    Jan

    Feb

    Mar

    Apr

    May

    Jun

    Jul

    Aug

    Ms

    Oct

    Nov

    Dec

    Sunday

    Monday

    Tuesday

    Wednesday

    Thursday

    Friday

    Saturday

    Sun

    LUN

    Mar

    Fri

    Game

    Fri

    Sam

    AM

    PM

    BRITISH COLUMBIA

    AD

    EEEE, MMMM D, YYYY

    MMMM D, YYYY

    MMM D, YYYY

    M/D/YY

    SS Z

    SS Z

    SS HAS

    h: mm A

    GyMdkHmsSEDFwWahKzZ

    z, zz9.zzz

    $z, zz9.99 | ($z, zz9.99)

    z, zz9%

    .

    ,

    %

    -

    0

    $

    USD

    .

    "RDF: RDF xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#

    ">

    "RDF: description xmlns:xmp ="http://ns.adobe.com/xap/1.0/"rdf: subject"

    ="">

    XMP:MetadataDate > 2012-02-28 T 14: 04:54Z

    >

    XMP:CreatorTool > Adobe LiveCycle Designer ARE 9.0

    >

    RDF: description

    >

    "RDF: description = xmlns:pdf"http://ns.adobe.com/pdf/1.3/"rdf: subject"

    ="">

    PDF:producer > Adobe LiveCycle Designer ARE 9.0

    >

    RDF: description

    >

    "RDF: description = xmlns:xmpMM"http://ns.adobe.com/xap/1.0/mm/"rdf: subject"

    ="">

    xmpMM:DocumentID > uuid:2c561cdf-3377-4e84-9a89-51e740bb2fea

    >

    RDF: description

    >

    "RDF: description = xmlns:desc"http://ns.adobe.com/xfa/promoted-desc/"rdf: subject"

    ="">

    DESC:version rdf:parseType = "resource".

    ">

    RDF: value > 9.0.0.0.20091029.1.612548.606130

    >

    DESC:REF > / template/subform [1]

    >

    DESC:version

    >

    RDF: description

    >

    RDF: RDF

    >

    x: xmpmeta >

  • Toggle button depends on the value of the selected row

    Hello.

    My problem is:

    I have a Table "singleSelect" and a button Delete.

    I´d want to toggle the button depends on the value of the selected row.

    I mean:

    C1: DepartmentId
    C2: Yes/No

    For each line: If c2 = "" then disable the rest button activates the button.

    I hope you can help me.

    I'm from Venezuela my English is not very good. :)

    Disabled = "#{row." C2 eq 'No'} '.

  • Select literal values in the same column

    Hello
    like the practice:

    Select 'A', 'B', 'C' for double
    will select these values in their own column on the same line, is there a simple way to select these values in the same column on lines without first their insertion into a table?

    Thank you
    SQL> select 'A' x from dual union
      2  select 'B' x from dual union
      3  select 'C' x from dual ;
    
    X
    -
    A
    B
    C
    

    A bit complicated:

    SQL> select chr(ascii('A')+level-1) x
      2  from dual
      3  connect by level <=3;
    
    X
    -
    A
    B
    C
    

    Other:

    SQL> select regexp_substr('ABC','[[:alpha:]]',1,level) x
      2  from dual
      3  connect by level <= length('ABC');
    
    X
    ---
    A
    B
    C
    

    Max
    http://oracleitalia.WordPress.com

    Published by: Massimo Ruocchio, February 12, 2010 17:55
    added a second

    Published by: Massimo Ruocchio, February 12, 2010 17:58
    Added the third

  • How to find the value dated the same day in the last year

    I want to know how to find the value dated the same day in the last year.

    I use now, there is the function with the year and the result is

    Year Rev There are Rev
    20113000
    201240003000
    201320004000
    201450002000

    It works but it's not that I want. I'm trying to add the column date (Ex.20140101) in my report but it'snot work.

    I want to show:

    Date Rev There are Rev
    20110112200
    20120112100200
    20130112300100
    20140112500300

    If use (< degree >, < time_dim >. < date >, 365), it works but does not correct 100%

    Please help me...

    Thank you very much

    Check this link cool - bi.com

  • IS THIS POSSIBLE AND IF YES COLOR 'HOW' TO HAVE DIFFERENT LINKS ON THE SAME PAGE?

    Hello

    IS THIS POSSIBLE AND IF YES COLOR 'HOW' TO HAVE DIFFERENT LINKS ON THE SAME PAGE?

    How to replace the color of Page link?

    See you soon,.

    Dreamer101.1

    Yes, it is possible, using CSS.

    Here's how. You already know that the link colors are set in the following css rules:

    • a: link
    • a: active
    • a: visited
    • a: hover

    All you have to do to have another set of links of different colors is to create another set of rules that set different colors and also have different names:

    • a.name1:link
    • a.name1: active
    • a.name1:visited
    • a.name1:hover

    Can link you these rules to the anchor as a class tag: something.

    You can have as many sets of rules to link given that the names you can think of.

    Happy linking!

  • By subtracting the values in the same column?

    Hello

    How can I subtract two values in the column of the table. EG - there is a table with two columns with date and cumulative turnover.

    Date Total_sales
    ===== =======
    February 23, 68
    24 feb-122
    25 feb-150
    26-Feb-200
    27 feb-223

    I need to know about the date that sales have been maximum. As we can see on 24 - Feb, sales were 54. We do this by subtracting 122-68.
    How can subtract us values in the same column?

    Thank you

    Take a look at the lag() of analytic SQL function which should give you what you need.

    See you soon,.
    Harry

  • the sum of the column lines based on distinct values of column B

    Hi all
    Here is my xml
    rowset <>
    < ROW >
    < ORDER_NO > 103-4385509 < / ORDER_NO >
    < SITE_NO > 103 < / SITE_NO >
    < ORDER_ID > 4385509 < / ORDER_ID >
    < CUSTOMER_ID > 2676832 < / CUSTOMER_ID >
    < TAX_AMOUNT >.33 < / TAX_AMOUNT >
    < CREATED_DATE > 20/08/2010 < / CREATED_DATE >
    < USER_CREATED > TSDAL671 < / USER_CREATED >
    < Delivery_Method > CARRY OUT STORE < / Delivery_Method >
    < Entered_By > TSDAL671 < / Entered_By >
    < SKU_NO > 321182 < / SKU_NO >
    < NAME_TEXT > MGR_OVERRIDE < / NAME_TEXT >
    < > 319 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    Override < ATTRIBUTE_VALUE > done < / ATTRIBUTE_VALUE >
    < DETAIL_SEQ_NO > 1 < / DETAIL_SEQ_NO >
    < / ROW >
    < ROW >
    < ORDER_NO > 103-4385509 < / ORDER_NO >
    < SITE_NO > 103 < / SITE_NO >
    < ORDER_ID > 4385509 < / ORDER_ID >
    < CUSTOMER_ID > 2676832 < / CUSTOMER_ID >
    < TAX_AMOUNT >.33 < / TAX_AMOUNT >
    < CREATED_DATE > 20/08/2010 < / CREATED_DATE >
    < USER_CREATED > TSDAL671 < / USER_CREATED >
    < Delivery_Method > CARRY OUT STORE < / Delivery_Method >
    < Entered_By > TSDAL671 < / Entered_By >
    < SKU_NO > 321182 < / SKU_NO >
    < NAME_TEXT > OEDTL_TAX_INFO < / NAME_TEXT >
    < > 314 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > 441130760 | 441130760 | 441130760 | 1. 1. 1. 20100820 | 2676832 | 2. SPARE PARTS | < / ATTRIBUTE_VALUE >
    < DETAIL_SEQ_NO > 1 < / DETAIL_SEQ_NO >
    < / ROW >
    < ROW >
    < ORDER_NO > 103-4385509 < / ORDER_NO >
    < SITE_NO > 103 < / SITE_NO >
    < ORDER_ID > 4385509 < / ORDER_ID >
    < CUSTOMER_ID > 2676832 < / CUSTOMER_ID >
    < TAX_AMOUNT >.18 < / TAX_AMOUNT >
    < CREATED_DATE > 20/08/2010 < / CREATED_DATE >
    < USER_CREATED > TSDAL671 < / USER_CREATED >
    < Delivery_Method > CARRY OUT STORE < / Delivery_Method >
    < Entered_By > TSDAL671 < / Entered_By >
    < SKU_NO > 412679 < / SKU_NO >
    < NAME_TEXT > OEDTL_TAX_INFO < / NAME_TEXT >
    < > 314 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > 441130760 | 441130760 | 441130760 | 1. 1. 1. 20100820 | 2676832 | 2. 0035 | < / ATTRIBUTE_VALUE >
    < DETAIL_SEQ_NO > 2 < / DETAIL_SEQ_NO >
    < / ROW >


    I have to display 3 lines but all the sum of TAX_AMOUNT grouped by ORDER_ID, I need sum for 2 records based on the distinct value of DETAIL_SEQ

    so my output should be something like below

    ORDER_ID | TAX_AMOUNT | DETAIL_SEQ | ATTRIBUTE_ID
    -----------------------------------------------------------------------------
    4385509 | 0.33 | 1. 319
    4385509 | 0.33 | 1. 314
    4385509 | 0.18 | 2. 314
    --------------------------------------
    SUM = 0.51
    ------------------------------------------


    Note: I can't make separate in the sql attribute_id is different for the same DETAIL_SEQ_NO.


    I tired to do <? sum ([xdoxslt:distinct_values (current - group () / DETAIL_SEQ_NO)] / TAX_AMOUNT)? >

    It did not work.

    Can someone help me please!



    Thanks in advance!

    This syntax will not work.

    A method to do so.

     
    
          
     
    
     
    
    
    
  • Follow-up - how can I order lines based on a value from column to HFR

    As discussed in my question on queries Top, I have a column that I ordered highest to lowest on a report.

    I have now, thanks to mballo, have a column of row (still hidden) as well as the column that contains the values. I have 25 rows. My use of the Rank ([M, 1:25].ifNN(-1), descending) provides values but no order.

    How can I get the lines sorted by the values in a particular column, then the first line has the highest value and the rest in descending order?

    J

    In the property sheet of grid, there is an option "comes out" about 1/2 at the bottom of the page. Once activated it will bring up a window that allows you to apply the sorting. You can take specific lines or all the rows and then apply that based on a column. Or vice versa.

  • Tabular presentation - column to turn it off (with picture) based on another value of the column

    Hi all

    I haven't worked much on tabular forms and JS. I'm looking for help in this regard.

    I'm working on a tabular presentation. with several editable fields... I need to disable a column (just for this single line), which contains an image, based on a field of LOV (static) list) (Y/N). The image column must be disabled if the value is N.

    My SQL for the report is something like this: (will keep things simple)

    Select

    emp_id,

    emp_name,

    static_list,

    (case when STATIC_LIST = "Y" THEN ' < a title = "Edit SAMPLE TBL" href = "f?) p = & APP_ID.:10: & APP_SESSION.:NO:P10_EMP_ID, P10_EMP_NAME :'|| EMP_ID | «, » || EMP_NAME | "" "> < img src =" "#IMAGE_PREFIX #SAMPLE.gif" border = '0' (> < /a > ' other ' ' end) as disable_col, "

    dept_name

    of sample_table

    I scoured the topics in this forum. Most of them were made using the table ID f_001, f_002.

    I tried to follow the same path by inspecting the item but the disable_col does not have any ID.  Let's say, f_003 is for the static list and f_004 is assigned to dept_name.

    I tried dynamic actions, but it did not work. Read in a topic that dynamic action does not work on tables. So I chose this approach. Is there a simpler way to solve this?

    need your help on how to proceed with this scenario. Thank you in advance.

    Versions: Apex: 4.2, DB: 11 g

    Thank you

    Daniel

    Hi Daniel_A,

    Daniel_A wrote:

    I did my job in Page 4.

    If the IS_VALID column is select as 'Yes' then the column hyper must be enabled, allowing the user to click on it. If she chose the 'no', then the column Hyper must be disabled for this line.

    The initial question about toggle the hyperlink is resolved. Check your App-> Page 4 35160.

    This is done with the help of two dynamic actions:

    • DA first loading of the Page / after updating of region "tabular":

    Event: After refresh

    Selection type: region

    Region: The other 'tabular '.

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $( 'select[name="f08"]' ).each(function() {
      if ( $(this).val() === "N" ) {
        $(this).closest("tr").find('td[headers="HYPER"]').find("a").addClass("apex_disabled").unbind("click");
      }
    });
    

    Items concerned: no item affected

    • Second DA on the evolution of the selection list:

    Event: change

    Selection type: jQuery Selector

    jQuery Selector: select [name = "f08"]

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: No.

    Code:

    var el = this.triggeringElement;
    if ( el.value === "N" ) {
        $(el).closest("tr").find('td[headers="HYPER"]').find("a").addClass("apex_disabled").unbind("click");
    } else {
        $(el).closest("tr").find('td[headers="HYPER"]').find("a").removeClass("apex_disabled").bind("click");
    }
    

    Items concerned: no item affected

    NOTE: as the original question/topic related to toggle the image link in the column, for the problem with the Page 5, please create a new thread with the details.

    Kind regards

    Kiran

  • for each loop to print the values in the same line?


    Hi guys,.

    For our customer, I create a RTF file.

    In one line, I use this:

    Internal req. Ref #: <? for-each: G_2? > <? SEGMENT1? > <? end foreach? >

    Now when I run this report this part of line shows the values in separate lines

    Output:

    -----------------------------------------------

    Inside Ref No. DDE:

      226

    230

    ------------------------------------------------

    How can I make it back in the same line. Like this and separated by commas

    -----------------------------------------------

    Internal req. Ref #: 226 230

    ------------------------------------------------

    You can use inline grouping, please take a look at these posts:

    https://blogs.Oracle.com/XmlPublisher/entry/inline_grouping

    Re: Using conditional output

    Re: Display data from a list in a single field with values separated by commas

  • Make a column based on another value of the column in the same table

    JDev 11.1.1.6.0

    It may be a silly question but I'm stuck

    I need to conditionally return a column that said Condition is as if the value in the other column of the same table B is equal to F. I should make A column only when this condition is met. I tried the following code:

    < af:column sortProperty = "PhoneNumber1."
    sortable = "false".
    headerText = "#{bindings." A.hints.PhoneNumber1.label}.
    ID = "c146.
    rendering = "#{rank." PhoneNumber1ResponseFlag eq 'F'} ">"
    < af:outputText value = "#{rank." PhoneNumber1}.
    ID = "ot130" / >
    < / af:column >
    < af:column sortProperty = "PhoneNumber1ResponseFlag."
    sortable = "false".
    headerText = "#{bindings." B.hints.PhoneNumber1ResponseFlag.label}.
    ID = "c80" rendered = "true" >
    < af:outputText value = "#{rank." PhoneNumber1ResponseFlag}.
    ID = "ot129" / >
    < / af:column >

    The data presented in the table for the PhoneNumber1ResponseFlag column are F. Still my condition does not work.

    Well, I've finally sorted it myself by managed bean.

    Here are the steps I followed:

    1. Wrote a new bean managed.
    2. Added a Boolean variable called flag and made to true when the "'PhoneNumber1ResponseFlag ' current line attribute is equal to F."
    3. Changing the property made column on this indicator.

Maybe you are looking for