Dispalying Dynamic Colors in grid

Hi
I have saved color codes in database...
Now in form I want to display these stored colors in tabular form......
In "SET_ITEM_INSTANCE_PROPERTY" I can't use "FOREGROUnD_COLOR"
AND "BACKGROUND_COLOR". So I've to use VISUAL_ATTRIBUTE
and SET_VA_ATTRIBUTE to change the properties of VA
But for next record of grid property of Visual attribute changes, changing the color of previous record...
How to solve this problem ???

Hello,
This PL/SQL tool is useful to set colors of standard Forms elements like canvas, current record, items of a whole Forms application, but not to colorize a special element in a special circumstance.
To achieve your requirement, you have to use the Set_Item_Instance_Property() with a different Visual Attribute on every item of your block.
Francois

Similar Messages

  • Need to display COlumn headers dynamically in ALG Grid

    Hello,
    I need to display column headers dynamically in alv grid Display with its corresponding value.
    Column headers should be picked from a field in Final Internal table and its corresponding field will also need to pick from the same table.
    T_final... Suppose Field STCTS - (To pick coulmn headers)
                                      CCNGN - (To pick appropriate value for that column)
    Can anybody explain me how i can pass these values to ALV Grid using
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
      EXPORTING
        IT_FIELDCATALOG           = Y_I_FCAT
      IMPORTING
        EP_TABLE                  = DY_TABLE.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Any suggestions will be appreciated....
    Regards,
    Kittu

    Hi,
    Go thru this link, and the code of Mr.Dev Parbutteea
    Re: Probelm with Using Field Symbol in FM
    thanks
    Mahesh

  • Dynamically color to each column in Cross-tab report

    Hello All,
    I am a newbie in Crystal report,from last few weeks, i am working on cross tab crystal report.i have a requirement to show color dynamically for each column.i am adding an attachment how i want it. i tried dynamic coloring using object field formula but it is showing red color to all data.i want red color data when in 2nd  cross tab report data is beyond upper or lower limit in first cross tab table. it will be very helpful if somebody will give me any clue on this.... i read so many articles now it seem like impossible for me..:(
    i am using visual studio 2010 and sap crystal report version 13.0.0.99 for visual studio 2010.

    Hello Manish,
    I have attached a sample report that does this. You will need to remove the .txt extension from the attached file to open it as an .rpt file.
    Please right click on one of the value fields of the first cross tab in the report > Format Field > Common > Suppress if Duplicated conditional formula.
    The nested formula is as follows;
    numbervar array l;
    numbervar array u;
    numbervar x:=CurrentColumnIndex;
    if GridRowColumnValue ('@limit') = 'lower limit' then
    (redim preserve l[x];
    l[x]:= tonumber(CurrentFieldValue))
    else if GridRowColumnValue ('@limit') = 'upper limit' then
    (redim preserve u[x];
    u[x]:= tonumber(CurrentFieldValue));
    false
    So it assigns each lower and upper limit value for each client (in the sample it is country) to an array using the cross tabs column index to index the array and it ends in False as we don't actually want it to suppress if duplicated. This nested formula is just used to generate the arrays of upper and lower values.
    In the second cross tab if you again right click on one of the value fields > Format Field > Font > Color you will see the following conditional formula;
    numbervar array l;
    numbervar array u;
    numbervar x;
    if not(tonumber(CurrentFieldValue) in l[CurrentColumnIndex] to u[CurrentColumnIndex]) then
    crred
    else
    crblack
    So this compaes the current field value to range generated by the 2 arrays and assigns a color based on whether or not it is in the range.
    Regards,
    Graham

  • How to set dynamic color , based on xml element

    Hi,
    We have a requirement, where based on certain conditions, a cell will be shown in a specific color. We would like the coloir to be based on an XML element. The xml element will have values like '#FF00FF' etc..
    We tried using xsl attribute with the following syntax ,
    <xsl:attribute xdofo:ctx="block"name="color"><?stdcolor?></xsl:attribute><?end if?>
    where stdcolor is the xml element, but when we use this , this is giving a syntax error.
    Let us know, if this is possible or is there any other alternate way to do this.
    Regards,
    - Vasu -

    Hi Vasu,
    http://winrichman.blogspot.com/2008/09/how-to-set-dynamic-color-based-on-xml.html
    use the following :)
    <xsl:attribute xdofo:ctx="block" name="color" ><xsl:value-of select="stdcolor" /></xsl:attribute>
    TO get the colors you wanted , you can refer to
    http://www.w3schools.com/Html/html_colors.asp

  • Dynamic Color Swatch

    We would like to add Dynamic Color Swatch. does anybody know the easier way to do it?
    Our Product example: http://www.whitneyeve.com/bottoms/skinny-sweats
    Thank you.

    You need to explain more what you are trying to achieve. You mean when you change the attribute selection it changes the colour image rather then what looks to be the grouping dropdown you setup?
    You need a good level of javascript knowledge to code that functionality in BC. Would you be able to do that?

  • Dynamic Color for Workbook

    Hi Expert,
    by creating a colored workbook i notice the color was disappearing after the refresh.
    I decide to built a makro which can fix the color in each line.
    I done that manually.
    But i am looking for a makro which can dynamically color the cells.
    for example:
    1. Total sum--- > color red
    1.2 sub sum color yellow
    1.2.1 sub sum color grey
    I will not want to fix that, because if there is a change in  the result it can not match again.
    Thank for your help
    Gilo

    Banu / Gilo, i am going thru the same exercise. Our users wanted the TOP 15 customers, sub total and Overall total. We cannot achieve this in a query as a HTML page, so we decided to use precalculation server to broadcast as a workbook. I know we need to run the report in BEx and store the workbook and then do the broadcast. I want to know when we store it as a workbook can we write macro to get the Sub total and the overall total.
    Do u have any documentation or idea to achieve this. Once i get this i can play with formats and coloring.
    Thanks in advance.
    Anand

  • Dynamic Color Customization

    Does anybody know where I can get the source code (ie, color.pll and fmb) to implement the "Dynamic Color Customization" in the Oracle Forms?
    I saw this white paper in the Forms product center by Oracle Forms community and wondering about the source code.
    Thanks

    Hello,
    <p>The pl/sql code is available here</p>
    Francois

  • How can I dynamically change a Grids ro color

    Hi,
    I am using a grid within a component in my Flex application.
    I have an XML dataProvider, and I want to change the row
    colour of my Grid depending on a value coming form my dataProvider
    – but I cant seem to get this to work :(
    can anyone help / advise me on how I can dynamically change the
    colour of my grid row depending on a value coming from my XML
    DataProvider????
    For example:
    Within my component I have the following grid within an
    “MXML” component called myGrid.mxml:
    [CODE]<mx:Grid id="GGrid">
    <mx:GridRow backgroundColor="0xCFD8DA">
    <mx:GridItem>
    <mx:Label id=”name_lbl”/>
    </mx:GridItem>
    </mx:GridRow>
    <mx:GridRow backgroundColor="0xCFD8DA">
    <mx:GridItem>
    <mx:Label id=”expiryDate_lbl”/>
    </mx:GridItem>
    </mx:GridRow>
    <mx:GridRow id=”statusRow”>
    <mx:GridItem>
    <mx:Label id=”status_lbl”/>
    </mx:GridItem>
    </mx:GridRow>
    </mx:Grid>[/CODE]
    I am setting/declaring my results/variables form my
    dataProvider in the main Application (“MXML”) file:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns="*"
    creationComplete="initApp()" >
    <mx:HTTPService
    id="myResults"
    url="
    http://localhost/myResults.xml"
    resultFormat="e4x"
    result="myResultHandler(event)" />
    [CODE]<mx:Script>
    <![CDATA[
    import mx.core.Application;
    [Bindable]
    public var myDataFeed:XML;
    public function initApp():void
    myResults.send();
    public function myResultHandler(event:ResultEvent):void
    myDataFeed = event.result as XML;
    Application.application.myGrid.name_lbl.text =
    myDataFeed.name;
    Application.application.myGrid.expiryDate_lbl =
    myDataFeed.expiry;
    Application.application.myGrid.status_lbl.text =
    myDataFeed.status;
    if(myDataFeed.status == “OK”)
    Application.application.statusRow.backgroundColor="0xCFD8DA";
    else if (myDataFeed.status == “WARNING”)
    Application.application.statusRow.backgroundColor="0xFF9900";
    else if (myDataFeed.status == “CRITICAL”)
    Application.application.statusRow.backgroundColor="0xFF0000";
    ]]>
    </mx:Script>
    </mx:Application>[/CODE]
    however, I cannot access the property
    “backgroundColor” of the gridRow in this way:
    [CODE]Application.application.statusRow.backgroundColor[/CODE]
    As I get the following error:
    [CODE]Severity and Description Path Resource Location
    Creation Time
    Id 1119:
    Access of possibly undefined property backgroundColor through
    a reference with static type mx.containers:GridRow.
    enterpriseDB_new enterpriseDB_new.mxml
    line 721 1194443056449 19295[/CODE]
    can anyone help / advise me on how I can dynamically change the
    colour of my grid row depending on a value coming from my XML
    DataProvider????
    Thanks,
    Jon.

    quote:
    Originally posted by:
    ljonny18
    Hi,
    I am using a grid within a component in my Flex application.
    I have an XML dataProvider, and I want to change the row
    colour of my Grid depending on a value coming form my dataProvider
    – but I cant seem to get this to work :(
    can anyone help / advise me on how I can dynamically change the
    colour of my grid row depending on a value coming from my XML
    DataProvider????
    Thanks,
    Jon.
    Hi,
    a few hours ago I stumbled across this cookbook entry - it
    didn't solve MY problem, but maybe it provides a way to solve your
    problem?
    http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=61&product Id=2&loc=en_US
    From the article:
    quote:
    Changing the background color of a DataGrid cell is not as
    simple as changing some style because the default renderer for a
    DataGrid cell does not have a backgroundColor. Therefore, to do
    this simple task, you have to create a custom itemRenderer where
    you draw your own background in the updateDisplayList function.
    HTH
    Uwe

  • How to download only some fields(dynamically) from alv grid layouts

    I have ALV grid list.
    I have layouts for selecting sets of fields dynamically.
    If I select a particular layout, I want to download only those fields into an Excel sheet.
    If I select another layout, I want to download only fields of that layout , into an Excel sheet.
    Can u plz write examples.
    Narendra

    Hello ,
    Here it is.
      FIELD-SYMBOLS <FS> TYPE ANY.
      DATA: GR_ATTACHMENT TYPE Z48S3_ATTACHMENT,
            GT_ATTACHMENT TYPE Z48S3_ATTACHMENT_TAB,
            L_F_TITLE     TYPE SO_OBJ_DES,
            L_R_FIELDCAT  LIKE LINE OF GT_FIELDCAT,
            L_F_FIELD     LIKE L_R_FIELDCAT-FIELDNAME,
            L_F_EMAILID   TYPE Z48S3_RECEIVER,
            L_F_FIRST     TYPE C.
      IF SY-SYSID EQ G_C_DEV_SYSTEM OR
         SY-SYSID EQ G_C_QUA_SYSTEM.
        CONCATENATE SY-SYSID '/' SY-MANDT ':' INTO L_F_TITLE.
        CONDENSE L_F_TITLE.
        CONCATENATE L_F_TITLE SY-TITLE INTO L_F_TITLE SEPARATED BY SPACE.
      ELSE.
        L_F_TITLE = SY-TITLE.
      ENDIF.
      G_R_VARIANT-REPORT = SY-REPID.
      G_R_VARIANT-VARIANT = P_VARIAN.
      CALL FUNCTION 'REUSE_ALV_VARIANT_SELECT'
           EXPORTING
                I_DIALOG            = 'N'
                I_USER_SPECIFIC     = 'A'
                I_DEFAULT           = 'X'
                IT_DEFAULT_FIELDCAT = G_T_FIELDCAT
                I_LAYOUT            = GR_LAYOUT
           IMPORTING
                ET_FIELDCAT         = G_T_FIELDCAT
                ES_LAYOUT           = GR_LAYOUT
           CHANGING
                CS_VARIANT          = G_R_VARIANT
           EXCEPTIONS
                ERROR_MESSAGE       = 4
                OTHERS              = 4.
      SORT G_T_FIELDCAT BY COL_POS.
      PERFORM CREATE_EXCEL_ATTM_HEADING_ROW TABLES GT_ATTACHMENT
                                                   G_T_FIELDCAT.
      LOOP AT G_T_ALVLIST.
        L_F_FIRST = 'X'.
        LOOP AT G_T_FIELDCAT INTO L_R_FIELDCAT WHERE NO_OUT IS INITIAL.
          CLEAR GR_ATTACHMENT-XNEWLINE.
          IF NOT L_F_FIRST IS INITIAL.
            GR_ATTACHMENT-XNEWLINE = 'X'.
            CLEAR L_F_FIRST.
          ENDIF.
          CLEAR L_F_FIELD.
          CONCATENATE 'G_T_ALVLIST-' L_R_FIELDCAT-FIELDNAME
                 INTO L_F_FIELD.
          CONDENSE L_F_FIELD.
          ASSIGN (L_F_FIELD) TO <FS>.
          WRITE <FS> TO GR_ATTACHMENT-FIELDVALUE.
          UNASSIGN <FS>.
          APPEND GR_ATTACHMENT TO GT_ATTACHMENT.
        ENDLOOP.
      ENDLOOP.
    Regards,
    Vasanth

  • How can I change the highlight color of grid view folders in the dock?

    Using OSX 10.10 Yosemite, the highlight color for a folder in Grid view is barely noticeable.
    Can you spot the highlighted icon below?
    I've grown accustom to clicking the applications folder in the doc then typing a few letters to get me close to the app I want- now it takes an extra few seconds for me to visually find the icon that got highlighted.
    Is there a way to change the highlight color here?

    I would open up the grid spacing slightly so everything does not run together. In System Preferences > General, try setting Highlight color: Red. This won't change the grey selection background around the icon, but it will turn the background behind the icon text to red. That stands out. However, the collateral effect is that text you select in this editor, and other OS X applications, will now have a red background too. Changing colors will require a killall Finder in the Terminal. Actually set mine to #ffff00 which is a vivid yellow, which is more practical when selecting text in a document.

  • Change Color from grid lines in Flash 2D Line Chart

    Hi,
    does anybody know how to change the color from the grid lines in 2D Line Chart?
    The color is always black (000000), I will use gray (CCCCCC).
    I can use a custom XML. Can you give me an example please???
    Where can I read something about the possible XML-Tags in Custom XML for Charts?
    Best regards
    Simona

    Simona,
    anychart.com has XML reference you can use for the charting engine in APEX.
    Try using custom XML and sticking this inside the grid > values tag:
    <lines color='0xCCCCCC' />- Marco

  • Change the total and subtotal dynamically in ALV GRID

    Hi guys,
               I need to change the total and subtotal of field "AMOUNT" dynamically.I am using ALV GRID CONTROL(oops concept).I need to override the standard functionality.I need to show my own subtotal and total line instead of standard one .

    Hi
    I've understood it, I wanted to use OO Grid too, but I had to use the ALV list in order to write my total.
    If you need to use OO grid u can try to exclude all funcitonalities for the total, subtotal and sorting and insert in the output table the lines with your totals.
    Max

  • Dynamic color selection in Smartforms using tables

    I am printing a smartform in pdf, i am using  tables in smartforms where the number of column is dynamic, and say there can be cases where there will be no data in a particular column and if that is the case than i have to print a particular color say grey, so my question is how to achieve this functionality in smartform dynamically, i am printing it in PDF.
    Regards & thank,
    Pritam.

    you need to create the 2 text elements , and put the condtion like below
    if not value is initial.
    display text1
    else
    display text2.
    endif.
    in text2 element > Output options> put the color. which you want...

  • Dynamic color in cell of an SmartForm Table

    Hi Experts,
    How can i assign a color for a text in a cell (shading) in a smartform table?? Color depends of the data in smartform.
    Thanx

    I don't think we can do it dynamically.
    So, may be you have to create as many texts as you have colors conditions and assign relevent condition to each text.
    Regards,
    Naimesh Patel

  • Color of grid's row depending on it's content

    Hi. I'd like to ask You how to deretmine color of single grid's row? I have such situation that some records of itab have 2 fields equal, and consequently should be displayed in fifferent color. Could You give me some tips how to solve that? Greetings. P.

    Hi ,
    Check the below example .. u may get some idea.
    * Macro definition
    DEFINE m_fieldcat.
      add 1 to ls_fieldcat-col_pos.
      ls_fieldcat-fieldname   = &1.
      ls_fieldcat-ref_tabname = &2.
      append ls_fieldcat to lt_fieldcat.
    END-OF-DEFINITION.
    TYPE-POOLS: slis.                      " ALV Global types
    TYPES:
      BEGIN OF ty_vbak,
        vkorg TYPE vbak-vkorg,             " Sales organization
        kunnr TYPE vbak-kunnr,             " Sold-to party
        vbeln TYPE vbak-vbeln,             " Sales document
        netwr TYPE vbak-netwr,             " Net Value of the Sales Order
        line_color(4),                     " Line color
      END OF ty_vbak.
    DATA:
    * Data displayed
      gt_vbak TYPE TABLE OF ty_vbak.
    START-OF-SELECTION.
      PERFORM f_read_data.
      PERFORM f_fill_color.
      PERFORM f_display_data.
    *      Form  f_read_data
    FORM f_read_data.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
               FROM vbak UP TO 100 ROWS.
    ENDFORM.                               " F_READ_DATA
    *      Form  f_fill_color
    FORM f_fill_color.
      DATA l_rnd_value TYPE integer2.
      FIELD-SYMBOLS <vbak> TYPE ty_vbak.
      LOOP AT gt_vbak ASSIGNING <vbak>.
    *   Random value
        CALL FUNCTION 'RANDOM_I2'
          EXPORTING
            rnd_min   = 0
            rnd_max   = 3
          IMPORTING
            rnd_value = l_rnd_value.
        CASE l_rnd_value.
          WHEN 0.
            <vbak>-line_color = 'C100'.   " Blue.
          WHEN 1.
            <vbak>-line_color = 'C300'.   " Yellow.
          WHEN 2.
            <vbak>-line_color = 'C500'.   " Green.
          WHEN 3.
            <vbak>-line_color = 'C600'.   " Red.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                               " F_FILL_COLOR
    *      Form  f_display_data
    FORM f_display_data.
      DATA:
        ls_layout   TYPE slis_layout_alv,
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    * Build the field catalog
      m_fieldcat 'VKORG' 'VBAK'.
      m_fieldcat 'KUNNR' 'VBAK'.
      m_fieldcat 'VBELN' 'VBAK'.
      m_fieldcat 'NETWR' 'VBAK'.
    * Fill Layout - Name of the field with color
      ls_layout-info_fieldname = 'LINE_COLOR'.
    * Display the list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          is_layout   = ls_layout
          it_fieldcat = lt_fieldcat
        TABLES
          t_outtab    = gt_vbak.
    ENDFORM.
    Reward Points if it is Useful.
    Thanks,
    Manjunath MS

Maybe you are looking for