Alt row color in grouped output

I've always used the following code to alternate row colors
in a table of CFOUTPUT:
<tr bgcolor="#IIf(query.currentRow Mod 2, DE('cfcfcf'),
DE('eeeeee'))#">
However, when I use this code in a table with grouped output,
I get unpredictable row colors. For example, the first two rows
will be color1, the next two color2, then the next few rows will
alternate like I want.
I'm attaching the code I'm currently working on.
Any ideas how to get the alt row colors to display properly?
Thanks in advance...

Sorry, my initial search to find the answer came up nill.
When I searched again I found the answer which I'm pasting below.
It worked great.
===========================================================================
when you use the GROUP attribute of CFOUTPUT, your data is no
longer being output in the same order in which it was retrieved.
the CURRENTROW variable is no longer in chronological order (you're
displaying the first grouped element, then 1-n members of that
group, then repeating).
you'd need to set an iterating variable.
<cfset myRowCountVar = 0 />
<cfoutput query="q_remnts_f3" group="req_Cat">
<cfset myRowCountVar = myRowCountVar + 1 />
(now use 'myRowCountVar' to key off of to determine the
background color rather than currentrow)
charlie griefer (CJ)
http://charlie.griefer.com
@ #coldfusion / DALnet
=================================================================================

Similar Messages

  • GROUP attribute ruins alternate row coloring

    I had the alternate row colors working, but then when I added
    the "GROUP" attribute to my
    <cfoutput> tag, it's not working any more. More like
    random row coloring!
    Any thoughts?
    Thanks!
    Rick
    <table width="100%" border="1" cellspacing="0"
    cellpadding="0">
    <cfoutput query="q_reqmnts_f3" group="req_Cat">
    <tr bgcolor="###iif(currentrow MOD
    2,DE('c5c7c9'),DE('9dc7fc'))#">
    <td height="12"><font
    size="3"><strong>#req_Cat#</strong><br></font>
    <font size="3"><cfoutput>
    <li>     <strong>#req#</strong>   #Spec1#  #Spec2#  <a
    href="
    http://#Link#">#Link#</a> <br
    style="empty-cells:hide"></li></cfoutput><br>
    </td>
    </tr>
    </cfoutput>
    </table>

    when you use the GROUP attribute of CFOUTPUT, your data is no
    longer being output in the same order in which it was retrieved.
    the CURRENTROW variable is no longer in chronological order (you're
    displaying the first grouped element, then 1-n members of that
    group, then repeating).
    you'd need to set an iterating variable.
    <cfset myRowCountVar = 0 />
    <cfoutput query="q_remnts_f3" group="req_Cat">
    <cfset myRowCountVar = myRowCountVar + 1 />
    (now use 'myRowCountVar' to key off of to determine the
    background color rather than currentrow)

  • How To Restrict Number Of Rows For Multiple Group In Report Output

    Hi ,
    I have a requirement to restrict number of rows in report output.I have three different group , if i use same no of rows to restrict then output is as expected but if i want Deduction group should have 7 rows , earning should have 5 rows and Tax group have 3 rows in report output then XML tag is not working.
    Below is the XML tag i am using -
    First i have declare the variable to restrict the rows -
    <xsl:variable name="lpp" select="number(7)"/>
    <xsl:variable name="lpp1" select="number(5)"/>
    <xsl:variable name="lpp2" select="number(3)"/>
    For Each -
    <?for-each:PAYSLIP?>
    <xsl:variable xdofo:ctx="incontext" name="DedLines" select=".//AC_DEDUCTIONS"/>
    <xsl:variable xdofo:ctx="incontext" name="EarLines" select=".//AC_EARNINGS[ELEMENT_CLASSIFICATION!='Taxable Benefits']"/>
    <xsl:variable xdofo:ctx="incontext" name="EarTaxLines" select=".//AC_EARNINGS[ELEMENT_CLASSIFICATION='Taxable Benefits']>
    <?for-each:$DedLines?><?if:(position()-1) mod $lpp=0?> <xsl:variable name="start" xdofo:ctx="incontext" select="position()"/>
    <?if:(position()-1) mod $lpp1=0?><xsl:variable name="start1" xdofo:ctx="incontext" select="position()"/
    <?if:(position()-1) mod $lpp2=0?><xsl:variable name="start2" xdofo:ctx="incontext" select="position()"/>
    Report output is tabular form (one page has two column - Earning and Deduction ) . Tax group comes below earning group.
    Deduction Group -
    <?for-each-group:$DedLines;./REPORTING_NAME?><?if:position()>=$start and position()<$start+$lpp?>
    <?REPORTING_NAME?>
    <?end if?><?end for-each-group?>
    Earning Group -
    <?for-each-group:$EarLines;./REPORTING_NAME?><?if:position()>=$start1 and position()<$start1+$lpp1?>
    <?REPORTING_NAME?>
    <?end if?><?end for-each-group?>
    Tax Group -
    <?for-each-group:$EarTaxLines;./REPORTING_NAME?><?if:position()>=$start2 and position()<$start2+$lpp2?>
    <?REPORTING_NAME?>
    <?end if?><?end for-each-group?>
    Please let me know in case additional detail is require.
    Thanks in Advance.
    Thanks,
    Harsh
    Edited by: Harsh.rkg on Jan 14, 2013 9:43 PM

    variable lpp2 is declare to restrict EarTaxLines -
    <xsl:variable name="lpp2" select="number(2)"/>
    This will help to restrict the no of rows on one page , if we have more then two tax benefits line then layout will roll over to continuation page.
    As part of report output my expectation is if i restrict Earning , Deduction and Tax benefits to same no of line for example - variable lpp ,lpp1 and lpp2 have same value "number(2)" , we can see the layout is continue on next page (restrict every group can have max two lines) .This is the reason we have 4 header grid , deduction and Tax Benefit lines are rolled over to continuation page .But if we restrict different value for each variable then continuation page layout is missing .
    When we tried for <xsl:variable name="lpp2" select="number(3)"/> value continuation page layout is not getting generate for both employee number .

  • Want robust solution for alternating row color, resetting every group

    I would like a solution for displaying an alternating row color for my detail rows that resets every group, so that row 1 is always gray.
    Our Crystal designer provided this code to me:
    @rowcnt formula, suppressed, placed in Detail row:
    Shared numbervar rowcnt;
    rowcnt := rowcnt + 1;
    @resetrowcnt, suppressed, placed in Group row:
    Shared numbervar rowcnt;
    rowcnt := 0;
    Formatting formula, placed in Color in Detail > Section Expert:
    Shared numbervar rowcnt;
    if Remainder(rowcnt, 2) <> 0 then
    color(241,241,241)
    else
    crWhite
    This was working fine for me.
    However, it is suddenly not working in one of my reports.
    The report does happen to have two groups (rowcount.png).
    When the report is run, all rows are colored (rowcount02.png).
    This report was previously working fine!  I'm not sure what changed.
    In any case... surely there must be standard code to do this very standard formatting.
    I would be very grateful if someone could post some robust code to accomplish the following:
    REPORT DATA IN DETAIL ROW, ALTERNATE ROW BANDING:
    - Data in Detail row displays alternating row colors
    - Odd rows are always shaded, even rows not
    - Banding resets every group / does not continue pattern from previous group
    REPORT DATA IN GROUP ROW, ALTERNATE ROW BANDING:
    Some of our reports place row data in a group row (just the way it happened).
    If you could also modify your code in this case.
    Thank you!

    Hi Abhilash/Sastry, since I'm going to switch to Sastry's formulas, could you please confirm correctness of the following. I can't actually run this report, I can only provide it to our London office, bit of a lag for testing.
    @resetrowcnt:
    Whileprintingrecords;
    Numbervar cnt:=0;
    @rowcnt:
    Whileprintingrecords;
    if {HedgeDetails.StrategyID} <> previous({HedgeDetails.StrategyID}) and
    {HedgeDetails.DealID} <> previous({HedgeDetails.DealID}) then
         Numbervar cnt:=cnt+1;
    Details section (Suppress):
    not(OnFirstRecord) and
    {HedgeDetails.StrategyID}=previous({HedgeDetails.StrategyID}) and
    {HedgeDetails.DealID}=previous({HedgeDetails.DealID})
    Please note: Suppress checkbox is selected AND the above formula is entered.
    Details section (Color):
    Whileprintingrecords;
    Numbervar cnt;
    if cnt mod 2 <> 0 Then color(241,241,241) else crwhite

  • Row Color Help

    Hello,
    I have a .RTF template that I am modifying from a co-worker that I am not getting much assistance on. My problem is when Previewing the .RTF Template using PDF my row colors do not appear different for each row. The template is fine when not grouping but I think the grouping of the report causes this problem. Can anyone take a look at my template and/or shead any knowledge on this matter? Thanks ahead of time.

    I'm sorry, I had that backwards (which I included the code example and should have clued me in on NOT versus ONLY, i.e., alternate row coloring ONLY works in PDF).
    3.1.7 Alternate Table Rows Formatting Not Working in HTML, RTF, and Excel Outputs
    This issue applies to Versions 10.1.3.3, 10.1.3.3.1, 10.1.3.3.2, 10.1.3.3.3, 10.1.3.4, and 10.1.3.4.1.
    The user guide contains the "Row Formatting" topic that describes how to set the background color on alternate rows in a tabular report. This description works for PDF output only. In HTML, RTF, and Excel output formats, the alternate rows do not show the background color. In these output formats, all the rows appear with a white background.
    This issue has no workaround.

  • Grouped output required based on input group :No one???????

    Hi to all,
    I want grouped output based on input group.
    e.g
    SQL> select * from test_data;
    FIELD
    a
    b
    c
    d
    e
    a
    e
    c
    d
    e
    10 rows selected.
    SQL>
    Now I want grouped output like this
    When I give input set (a,b) then output should be :
    a,b
    a
    c
    c
    d
    d
    e
    e
    e
    When I give input set (a,e) then output should be :
    a,e
    a,e
    b
    c
    c
    d
    d
    e
    I want a query regarding this , I know this is possible through Pl/SQL, but the requirement is through query.....
    rgds,
    Rup

    I want grouped output based on input group.
    I want a query regarding this
    with
    test_data as
    ( select substr(p, instr(p, ',', 1, level) + 1, instr(p, ',', 2, level) - instr(p, ',', 1, level) - 1) as field
        from (select ',' || 'a,b,c,d,e,a,e,c,d,e' || ',' as p from dual)
        connect by level <= length(p) - length(replace(p, ',')) - 1
    input_set as
    ( select distinct substr(p, instr(p, ',', 1, level) + 1, instr(p, ',', 2, level) - instr(p, ',', 1, level) - 1) as field
        from (select ',' || 'a,d,e' || ',' as p from dual)
        connect by level <= length(p) - length(replace(p, ',')) - 1
    group_count as
    ( select min(count(i.field)) as group_cnt
        from test_data t, input_set i
        where i.field(+) = t.field
        group by t.field
        having count(i.field) > 0
    test_data2 as
    ( select field,
          row_number() over (partition by field order by null) as group_no1,
          row_number() over (                   order by null) as group_no2
        from test_data
    input_set2 as
    ( select field, row_number() over (order by field) as item_no
        from input_set
    select max(fields) as fields
      from
      ( select
            replace(sys_connect_by_path(decode(level, 1, group_no2), '-'), '-') as group_no,
            ltrim(sys_connect_by_path(t.field, ','), ',') as fields,
            level as lvl
          from test_data2 t, input_set2 i, group_count
          where i.field(+) = t.field
          start with group_no1 > group_cnt or item_no = 1 or item_no is null
          connect by prior group_no1 <= group_cnt and group_no1 = prior group_no1 and item_no = prior item_no + 1
      group by group_no
      order by max(lvl) desc, fields
    FIELDS
    a,d,e
    a,d,e
    b
    c
    c
    e
    6 rows selected.

  • Re: Is it possible to change row colors on array fields ors

    HI Martin!
    Yes, it is possible to change row colors on array fields.
    I have attached a PEX (tools.pex) which has an object which changes FillColor
    and PenColor for Arrays. The PEX has it's own test window, so you can try
    various combinations. (There are a few other Objects in the Project which are
    not relevant
    I'm not sure that you can change colors on individual choices in a scroll list.
    I haven't tried playing around with it.
    The test window actually changes the color of scroll lists as well.
    The object keeps track of which rows have changed color, same with pen color, so
    that when you scroll it keeps track of which rows are a different colors.
    The pex is self-contained, just import the file and do a test run.
    Please let me know if you have any problems.
    -later
    -labeaux
    Is it possible to change row colors on array fields or scroll lists?
    I need to create a list field that will allow me to dynamically change the
    fillColor and/or penColor attributes of individual rows. (I just want to
    highlight the rows, and those seem to be the obvious attributes...) It appears
    you can't do that on scroll lists (the elements are list elements, and don't
    have those attributes) and I can't figure out how to do it on an array field
    either. Any ideas for how to accomplish this?
    -Martin ([email protected])

    FreshWebmuse,
    Version 2 of iCal has the "Group Calendar" feature. It was released as part of Mac OS X v10.4, and if you really want/need that feature you will have to upgrade to Tiger.
    ;~)

  • Can you change the color of the output in the console?

    When you run your program using NetBeans the color of the output in the console window is black. Is there any way to change the color of the output to say blue?

    Hi AJL,
    There is no way to color rows of the table control in a SUDialog. You could consider using the ActiveX container control and using the Microsoft ActiveX table control, which might have that functionality. Note though, that then you need to either ensure that control is always on all your client machines or make provisions for it to be installed/registered.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Alternating Row Colors - Interactive Report

    Hello All,
    I'm hoping someone out there can help me out w/this. :)
    I'm a newbie working w/an Interactive Report and want to have alternating row colors as a default w/out losing the IR advantages.
    I've tried javascript, but, whenever filters are applied the class gets stripped off.
    Has anyone had any luck w/this?
    Thanks In Advance

    Roel,
    I got it working... Adding the onload to the image is pretty awesome, I had to chuckle cause I would've never thought of that.
    It wasn't working for me earlier, but, i realized after it was a silly syntax error. :P
    Anywho - Check the link below.
    http://apex.oracle.com/pls/otn/f?p=17445:7::::::
    I had used a different striping script which was written by a buddy of mine Keith Daulton (Had to throw him props for a hawt script. Works in ie6/7, FF, Chrome & Safari).
    I'm 100% sure I'm not the only one who's wanted this done and struggled to get it. So below I'm providing it for those who run into this thread.
    <script type="text/javascript">
    // THIS DOES THE STRIPING
    function decorateDataGrids (strClass) {
         var tables = document.getElementsByTagName("table");
         for (var i=tables.length; i--;) {
              if (tables.className == strClass) {
                   var gridRows = tables[i].getElementsByTagName("tr");
                   for (var j=gridRows.length; j--;) { if (j%2) { gridRows[j].className = "even"; } }
    window.onload = function () {
         decorateDataGrids("apexir_WORKSHEET_DATA"); // THIS DOES THE STRIPING
    </script>
    <style>
    /* THIS OVERRIDES APEX'S DEFAULT STYLES */
    table.apexir_WORKSHEET_DATA tr.even td {
         background-color:#F1F5FA !important;
    table.apexir_WORKSHEET_DATA td {
         background-color:#FFFFFF !important;
         border:1px solid #B3B3A7 !important;
         padding:4px 8px !important;
    </style>
    onload event strapped to the img -- Thanks!!!
    <img src="#IMAGE_PREFIX#edit.gif" alt="" onload="decorateDataGrids('apexir_WORKSHEET_DATA');">
    Edited by: user11086646 on Jun 9, 2009 7:04 PM

  • Displaying row color issue...

    I have a html table output having 20 rows (fixed).
    <% for loop {............%>
    <tr>
    <td>
    Value 1
    </td>
    <td>
    <%= value1 %>
    </td>
    </tr>
    <tr>
    <td>
    Value 2
    </td>
    <td>
    <%= value2 %>
    </td>
    </tr>
    <tr>
    <td>
    Value 3
    </td>
    <td>
    <%= value3 %>
    </td>
    </tr>
    <% } %>
    ..............goes until value 20. Instead to hard code each row color in each TR, I want to build some logic to display row color in blue/white alternatively.
    Any idea?

    Please find the example for the alternate color, this will work not only for fixed table size but also for dynamic table size...
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <script language="Javascript">
         function alternate(id) {
              if(document.getElementsByTagName) { 
                   var table = document.getElementById(id);  
                   var rows = table.getElementsByTagName("tr");  
                   for(i = 1; i < rows.length; i++) {          
                        //manipulate rows
                        if(i % 2 == 0)
                             rows.className = "even";
                        else
                        rows[i].className = "odd";
    </script>
    <style type="text/css">
    .odd{background-color: '#EEEDF0';}
    .even{background-color: '#DFE8F2';}
    </style>
    </HEAD>
    <BODY onLoad="alternate('theTable')" bgcolor="#EEEDF0" >
    <u>This is an example of alternating row colors:</ul>
    <table id="theTable" cellspacing="0" cellpadding="0" >
    <tr bgcolor="#BECFDA">
         <td>Vehicle Model</td>
         <td width="50"></td>
         <td>Account Number</td>
         <td width="50"></td>
         <td>Status</td>
         <td width="50"></td>
         <td>Amount</td>
    </tr>
    <tr>
         <td>2003 XRS</td>
         <td width="50"></td>
         <td>345334254</td>
         <td width="50"></td>
         <td>Processing</td>
         <td width="50"></td>
         <td>$243.21</td>
    </tr>
    <tr>
         <td>2003 TRY</td>
         <td width="50"></td>
         <td>11098544</td>
         <td width="50"></td>
         <td>Processing</td>
         <td width="50"></td>
         <td>$481.21</td>
    </tr>
    <tr>
         <td>2003 FRS</td>
         <td width="50"></td>
         <td>345334254</td>
         <td width="50"></td>
         <td>Processing</td>
         <td width="50"></td>
         <td>$50</td>
    </tr>
    </table>
    </BODY>
    </HTML>
    -Bala

  • ALV LIST - ROW COLORS

    Can we change row colors according to the values in ALV LIST
    Reg,
    Archana

    hai  Archana,
    REPORT zcuitest_alv_07.
    Use of colours in ALV grid (cell, line and column)            *
    Table
    TABLES : mara.
    Type
    TYPES : BEGIN OF ty_mara,
              matnr         LIKE mara-matnr,
              matkl         LIKE mara-matkl,
              counter(4)    TYPE n,
              free_text(15) TYPE c,
              color_line(4) TYPE c,           " Line color
              color_cell    TYPE lvc_t_scol,  " Cell color
    END OF ty_mara.
    Structures
    DATA  : wa_mara     TYPE ty_mara,
            wa_fieldcat TYPE lvc_s_fcat,
            is_layout   TYPE lvc_s_layo,
            wa_color    TYPE lvc_s_scol.
    Internal table
    DATA : it_mara     TYPE STANDARD TABLE OF ty_mara,
           it_fieldcat TYPE STANDARD TABLE OF lvc_s_fcat,
           it_color    TYPE TABLE          OF lvc_s_scol.
    Variables
    DATA : okcode LIKE sy-ucomm,
           w_alv_grid          TYPE REF TO cl_gui_alv_grid,
           w_docking_container TYPE REF TO cl_gui_docking_container.
    PARAMETERS : p_column AS CHECKBOX,
                 p_line   AS CHECKBOX,
                 p_cell   AS CHECKBOX.
    START-OF-SELECTION.
      PERFORM get_data.
    END-OF-SELECTION.
      PERFORM fill_catalog.
      PERFORM fill_layout.
      CALL SCREEN 2000.
    *&      Module  status_2000  OUTPUT
          text
    MODULE status_2000 OUTPUT.
      SET PF-STATUS '2000'.
    ENDMODULE.                 " status_2000  OUTPUT
    *&      Module  user_command_2000  INPUT
          text
    MODULE user_command_2000 INPUT.
      DATA : w_okcode LIKE sy-ucomm.
      MOVE okcode TO w_okcode.
      CLEAR okcode.
      CASE w_okcode.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " user_command_2000  INPUT
    *&      Module  alv_grid  OUTPUT
          text
    MODULE alv_grid OUTPUT.
      IF w_docking_container IS INITIAL.
        PERFORM create_objects.
        PERFORM display_alv_grid.
      ENDIF.
    ENDMODULE.                 " alv_grid  OUTPUT
    *&      Form  create_objects
          text
    -->  p1        text
    <--  p2        text
    FORM create_objects.
    Ratio must be included in [5..95]
      CREATE OBJECT w_docking_container
        EXPORTING
          ratio                       = 95
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5
          others                      = 6.
      CREATE OBJECT w_alv_grid
        EXPORTING
          i_parent          = w_docking_container.
    ENDFORM.                    " create_objects
    *&      Form  display_alv_grid
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv_grid.
      CALL METHOD w_alv_grid->set_table_for_first_display
        EXPORTING
          is_layout                     = is_layout
        CHANGING
          it_outtab                     = it_mara
          it_fieldcatalog               = it_fieldcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
    ENDFORM.                    " display_alv_grid
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    FORM get_data.
      SELECT * FROM mara UP TO 5 ROWS.
        CLEAR : wa_mara-color_line, wa_mara-color_cell.
        MOVE-CORRESPONDING mara TO wa_mara.
        ADD 1                   TO wa_mara-counter.
        MOVE 'Blabla'           TO wa_mara-free_text.
        IF wa_mara-counter = '0002'
        AND p_line = 'X'.
    Color line
          MOVE 'C410' TO wa_mara-color_line.
        ELSEIF wa_mara-counter = '0004'
        AND p_cell = 'X'.
    Color cell
          MOVE 'FREE_TEXT' TO wa_color-fname.
          MOVE '5'         TO wa_color-color-col.
          MOVE '1'         TO wa_color-color-int.
          MOVE '1'         TO wa_color-color-inv.
          APPEND wa_color TO it_color.
          wa_mara-color_cell[] = it_color[].
        ENDIF.
        APPEND wa_mara TO it_mara.
      ENDSELECT.
    ENDFORM.                    " get_data
    *&      Form  fill_catalog
          text
    -->  p1        text
    <--  p2        text
    FORM fill_catalog.
    Colour code :                                                 *
    Colour is a 4-char field where :                              *
                 - 1st char = C (color property)                  *
                 - 2nd char = color code (from 0 to 7)            *
                                     0 = background color         *
                                     1 = blue                     *
                                     2 = gray                     *
                                     3 = yellow                   *
                                     4 = blue/gray                *
                                     5 = green                    *
                                     6 = red                      *
                                     7 = orange                   *
                 - 3rd char = intensified (0=off, 1=on)           *
                 - 4th char = inverse display (0=off, 1=on)       *
    Colour overwriting priority :                                 *
      1. Line                                                     *
      2. Cell                                                     *
      3. Column                                                   *
      DATA : w_position TYPE i VALUE '1'.
      CLEAR wa_fieldcat.
      MOVE w_position TO wa_fieldcat-col_pos.
      MOVE 'MATNR'    TO wa_fieldcat-fieldname.
      MOVE 'MARA'     TO wa_fieldcat-ref_table.
      MOVE 'MATNR'    TO wa_fieldcat-ref_field.
      APPEND wa_fieldcat TO it_fieldcat.
      ADD 1 TO w_position.
      CLEAR wa_fieldcat.
      MOVE w_position TO wa_fieldcat-col_pos.
      MOVE 'MATKL'    TO wa_fieldcat-fieldname.
      MOVE 'MARA'     TO wa_fieldcat-ref_table.
      MOVE 'MATKL'    TO wa_fieldcat-ref_field.
    Color column
      IF p_column = 'X'.
        MOVE 'C610'     TO wa_fieldcat-emphasize.
      ENDIF.
      APPEND wa_fieldcat TO it_fieldcat.
      ADD 1 TO w_position.
      CLEAR wa_fieldcat.
      MOVE w_position TO wa_fieldcat-col_pos.
      MOVE 'COUNTER'  TO wa_fieldcat-fieldname.
      MOVE 'N'        TO wa_fieldcat-inttype.
      MOVE '4'        TO wa_fieldcat-intlen.
      MOVE 'Counter'  TO wa_fieldcat-coltext.
      APPEND wa_fieldcat TO it_fieldcat.
      ADD 1 TO w_position.
      CLEAR wa_fieldcat.
      MOVE w_position  TO wa_fieldcat-col_pos.
      MOVE 'FREE_TEXT' TO wa_fieldcat-fieldname.
      MOVE 'C'         TO wa_fieldcat-inttype.
      MOVE '20'        TO wa_fieldcat-intlen.
      MOVE 'Text'      TO wa_fieldcat-coltext.
      APPEND wa_fieldcat TO it_fieldcat.
    ENDFORM.                    " fill_catalog
    *&      Form  fill_layout
          text
    -->  p1        text
    <--  p2        text
    FORM fill_layout.
    Field that identify color line in internal table
      MOVE 'COLOR_LINE' TO is_layout-info_fname.
    Field that identify cell color in inetrnal table
      MOVE 'COLOR_CELL' TO is_layout-ctab_fname.
    ENDFORM.                    " fill_layout
    Regards.
    Eshwar.

  • Report Template - Standard, Alternating Row Colors

    I'm using APEX 4.1.0 and theme 22 on Oracle 10g.
    I have some tabular forms in my application. For 2 of those, row deletions are allowed and I have the usual select box column to manage the row deletions. Also my users like the "Standard, Alternating Row Colors" report template and would like to see the alternating row colors whenever possible. Unfortunately I get the "Error on page." browser error in IE when I check a row selector box using this template. When I use a different report template I don't get this error.
    The tabular form functions correctly so this error is harmless, but I would like to know what it is for. I'm sure my users would rather not see that error.
    By the way, in Firefox the firebug error count increases and I get the following error in the console:
    TypeError: can't convert undefined to object
    [Break On This Error]      
    ...ovedColor)}gLastRowMoved=b}function html_RowUp(e,d){var c=$x_UpTill(e,"TR");ie_R...
    apex_4_1.min.js (line 18)Because all of the whitespace has been helpfully removed :) it's hard to see which expression is undefined and why.
    Any ideas?

    Hi Jackie,
    There must be some issues the apex_4_1.min.js file, try to reload it. In apex.oracle.com the tabular form with "Standard, Alternating Row Colors" just works fine.
    Regards,
    Natarajan

  • How do I find the index of a row of a group in a presentation?

    I am using a BPM Object Presentation for this and the code is in PBL. From a method (triggered by an event) I need to find out the current row, the index within a Group. (In this case I am referring to the Group array widget, not a user group.)
    The specific implementation is as follows:
    1. Each row of the group has a button named "Edit Topic"
    2. The user clicks the button
    3. The action for that button calls the method EditTopic()
    4. The method EditTopic() needs to know which row it was triggered from.
    Thanks in advance.

    Hi,
    You can retrieve the zero based value of the row in a Group clicked if you add a method inside of the group (make sure it's inside the group and not in the parent BPM Object).
    The presentation's property for the push button inside the group has to be designated as an "action" (vs submit, save or cancel). Name the method associated with the push button in the group something like "getLineClicked()".
    The method only needs to have this one line of logic:
    lineSelected as Int = orderLines.indexOf(this)
    This will give you the zero based index of the row in the group they picked.
    Hope this helps,
    Dan

  • Getting the first row for each group

    Hi Everyone,
    I have a query which returns a number of rows, all of which are valid. What I need to do is to get the first row for each group and work with those records.
    For example ...
    client flight startairport destairport stops
    A fl123 LGW BKK 2
    A fl124 LHR BKK 5
    B fl432 LGW XYZ 7
    B fl432 MAN ABC 8
    .... etc.
    I would need to return one row for Client A and one row for Client B (etc.) but find that I can't use the MIN function because it would return the MIN value for each column (i.e. mix up the rows). I also can use the rownum=1 because this would only return one row rather than one row per group (i.e. per client).
    I have been investigating and most postings seem to say that it needs a second query to look up the first row for each grouping. This is a solution which would not really be practical because my query is already quite complex and incorporating duplicate subqueries would just make the whole thing much to cumbersome.
    So what I really new is a "MIN by group" or a "TOP by group" or a "ROWNUM=1 by group" function.
    Can anyone help me with this? I'm sure that there must be a command to handle this.
    Regards and any thanks,
    Alan Searle
    Cologne, Germany

    Something like this:
    select *
    from (
       select table1.*
       row_number() over (partition by col1, col2 order by col3, col4) rn
       from table1
    where rn = 1In the "partition by" clause you place what you normally would "group by".
    In the "order by" clause you define which will have row_number = 1.
    Edit:
    PS. The [url http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions004.htm#i81407]docs have more examples on using analytical functions ;-)
    Edited by: Kim Berg Hansen on Sep 16, 2011 10:46 AM

  • HOw Do I count and identify the number of groups in a groups output.

    I have a query that reads like this..
    SELECT s.spec_Sort,s.spec_ID, s.spec_Name, b.bus_Name,
    b.bus_ID
    FROM (tbl_businesses as b INNER JOIN tbl_SpecBusRel as sb ON
    b.bus_ID = sb.specbus_busid) INNER JOIN tbl_specialties as s ON
    sb.specbus_specid = s.spec_ID
    ORDER BY s.spec_Sort, b.bus_Name
    and then I am outputing like this...
    <cfoutput query="rsGetSpecialties" group="spec_Name">
    <cfif THIS IS WHAT I
    NEED)></td><td></cfif>
    <h2><a class="specialty" href="javascript;"
    onclick="dwfaq_ToggleOMaticDisplay(this,'#spec_ID#');return
    document.MM_returnValue">#spec_Name#</a></h2>
    <div id="#spec_ID#" style="display:none">
    <cfoutput><p><a
    href="#request.details#?bus_ID=#bus_ID#">#bus_Name#</a></p></cfoutput>
    </div>
    </cfoutput>
    This displays in this manner...
    Specialty
    dealer
    Specialty
    dealer1
    dealer2
    Etc...
    What I am trying to do is find out how many specialties there
    are, figure out where the middle is so I can insert a new table
    data cell and start a new column.
    Basically - two columns with the data divided in half by
    specialty NOT by the number of dealers.
    I hope that makes sense. Of course I am trying to do it w/ as
    little query action as possible. My only solution may be to have
    more than one query and the second only finds a list of the
    sepcialties that contain the dealers and then find the middle one
    and simply say if current specialty = middleSpecialty then start a
    new column.
    Thanks all,
    Chris

    Thanks for the replies. I don't need the number of occurances
    of each specialties - I simply need to know how many specialties
    there are and then split them in half.
    This may be the long way around -but it is what I did...
    <cfquery name="rsGetSpecialties" >
    SELECT s.spec_Sort,s.spec_ID, s.spec_Name, b.bus_Name,
    b.bus_ID, b.bus_Pcity, b.bus_PState
    FROM (tbl_businesses as b INNER JOIN tbl_SpecBusRel as sb ON
    b.bus_ID = sb.specbus_busid) INNER JOIN tbl_specialties as s ON
    sb.specbus_specid = s.spec_ID
    ORDER BY s.spec_Sort, b.bus_Name
    </cfquery>
    <cfset specs = valuelist(rsGetSpecialties.spec_ID)>
    <cfquery name="rsListSpecialties">
    SELECT spec_ID,spec_Name
    FROM tbl_specialties
    WHERE spec_ID in(#specs#)
    ORDER BY spec_Name
    </cfquery>
    <cfset middle = int(rsListSpecialties.recordcount/2)>
    <cfset specs = valuelist(rsListSpecialties.spec_Name)>
    <cfset middle = listgetat(#specs#,middle)>
    then displayed like this...
    <td valign="top" width="50%">
    <cfoutput query="rsGetSpecialties" group="spec_Name">
    <h2><a class="specialty" href="javascript;"
    onclick="dwfaq_ToggleOMaticDisplay(this,'#spec_ID#');return
    document.MM_returnValue">#spec_Name#</a></h2>
    <div id="#spec_ID#" style="display:none">
    <cfoutput><a
    href="#request.details#?bus_ID=#bus_ID#">#bus_Name#
    (#bus_PCity#, #bus_PState#)</a><br /></cfoutput>
    </div>
    *****This is the line that does the splitting *****
    <cfif spec_Name EQ middle></td><td
    valign="top" width="50%"></cfif>
    </cfoutput>
    </td>
    As for removing the extraneous cfoutput --> I thought that
    I needed that in order to show the material within the grouped
    data. HOw does CF know what data to repeat and what data to not
    repeat in a grouped output? I will have to look this one up some
    more.
    thanks for the help

Maybe you are looking for

  • IOS iCloud access is a real flaw. There should be a way to access my iCloud stuff on the web from my portables

    iOS iCloud access is a real flaw. There should be a way ic an use my mobile devices to access my iCloud content on the web. The push probably works if you are on a fits network, but ia m in a rural community and use my iPad as a laptop when I am work

  • Display of my Macbook Pro gets distorted/pixelated out of nowhere! Help!

    I don't know what's wrong with my laptop, the display suddenly turns all pixalated in different colors, making it impossible to read anything! And it happens when I'm browsing the web, not even watching videos. The only way to fix it is by restarting

  • Snow Leopard Updates Not Working

    I go to the Software update, it finds the various updates required for my mac, firmware, itunes n all that. I say, install and restart.  A few pop ups open telling me to have at least 25% battery and my computer is going to restart, I confirm them al

  • Missing videos after rendering

    Hello! I'm a newbie with After Effects. I have the following problem: I have a After Effects Project file. In the folder Media Holders there are files with names MEDIA HOLDER 1, MEDIA HOLDER 2, etc. How do I replace them with my files? With right-cli

  • Service Level Objectives failing

    Hi, I have created a number of Service Level Objectives for incident resolution times based on priority (in SCSM 2012 sp1).  They were all working fine but some thing has happened and now they are not being applied to the incidents that should be get