Change Column Header / Column Background color based on a value in a specific row in the same column

SSRS 2012
Dataset (40 columns) including the first 3 rows for Report layout configuration (eg: the <second> row specifies the column background color).
Starting from the 4th row, the dataset contains data to be displayed.
I would like to change the background color of the ColumnHeader/Column based on the value in the same column in the <second> row.
How can I accomplish the this requirement? (this must be applied for all the columns)
Thanks

Hi Fasttrck2,
Per my understanding that you want to specify the background color of all the columns/column header based on the value in one special column of the special row, right?
I have tested on my local environment and you can add expression to condition show the background color in the columns properties or the column header properties.
Details information below for your reference:
Specify the background color in the Column header: you can select the entire column header row and in the properties add expression in the Background color :
If you want to specify the background color for the entire column, you can select the entire column and add the expression, repeat to add background color for other columns.
If you want to specify the background color based on the value in the specific columns and row, you can create an hidden parameter to get the list of values from the  specific column, specify the Available values and default values by select "Get
values from a query", finally using the expression as below to get the specific value you want:
Expression(Backgroud Color):
=IIF(Parameters!Para.Value(1)="1221","red","yellow")
If your problem still exists, please try to provide some smaple data of the report and also the snapshot of the report structure to help us more effective to provide an solution.
Any problem, please feel free to ask.
Regards
Vicky Liu
If you have any feedback on our support, please click
here.
Vicky Liu
TechNet Community Support

Similar Messages

  • Subtracting two rows from the same column

    Hi,
    I have the following table with about 6000 rows of different year_month but I am compare and subtract v
    Organization     Year_month     Contribution
    Kano     JAN-2011     200000
    KADUNA     JAN-2011     300000
    ABUJA     JAN-2011     400000
    Kano     FEB-2011     300000
    KADUNA     FEB-2011     200000
    ABUJA     FEB-2012     600000
    I want to select a year_month at run time to subtract the contribution of the first year_month from the contribution of the second year_month and give me the result as shown in the following table
    Organization     JAN-2011     FEB-2011     diffrence
    Kano     200000     300000     -100000
    KADUNA     300000     200000     100000
    ABUJA     400000     600000     -200000
    Here is my code returning too many va
    create or replace function "GET_MONTHLY_VALUE"
    (q_name in VARCHAR2,
    hmoCode in VARCHAR2)
    return VARCHAR2
    is
    c1 number;
    begin
    select NHIS_CONTRIBUTION into c1 from CONTRIBUTION_MGT where upper(YEAR_MONTH)=upper(q_name) and upper(ORGANIZATION)=upper(hmoCode);
    return c1;
    exception when NO_DATA_FOUND THEN
    return null;
    end;
    ------a call to the above function:
    create or replace function process_cont_monthly return varchar
    is
    Cursor cont_cursor is select ORGANIZATION from CONTRIBUTION_MGT;
    begin
    for
    cont_rec in cont_cursor loop
    select GET_MONTHLY_VALUE(:p26_month,cont_rec.ORGANIZATION) first, GET_MONTHLY_VALUE(:p26_month2,cont_rec.ORGANIZATION) second,
    abs(GET_MONTHLY_VALUE(:p26_month,cont_rec.ORGANIZATION)-GET_MONTHLY_VALUE(:p26_month2,cont_rec.ORGANIZATION)) Diffrence
    from CONTRIBUTION_MGT;
    end loop;
    commit;
    end;
    I became totally confused and don’t know what to do next
    Any help and better guide is appreciated

    Hi,
    Here's one way:
    WITH    months_wanted     AS
         SELECT     1 AS col, TO_DATE ('JAN-2011', 'MON-YYYY') AS month     FROM dual     
        UNION ALL
         SELECT     2 AS col, TO_DATE ('FEB-2011', 'MON-YYYY') AS month     FROM dual     
    ,     pivoted_data     AS
         SELECT       c.organization
         ,       NVL (SUM (CASE WHEN m.col = 1 THEN c.contribution END), 0)     AS total_1
         ,       NVL (SUM (CASE WHEN m.col = 2 THEN c.contribution END), 0)     AS total_2
         FROM       months_wanted     m
         JOIN       contribution_mgt  c ON  c.year_month >=            m.month
                                     AND c.year_month < ADD_MONTHS (m.month, 1)
    SELECT    organization
    ,       total_1
    ,       total_2
    ,       total_1 - total_2     AS difference
    FROM       pivoted_data
    ORDER BY  organization
    ;I assume that the year_month column is a DATE. Date information always belongs in DATE columns.
    As written, the two months do not need to be consecutive. If you always want consectuive months, this can be re-written so that you only have to enter the first month, not both of them.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Point out a few places where the query above is giving the wrong results, and explain, using specific examples, how you get those results from that data in those places. If you changed the query at all, post your code.
    Always say which version of Oracle you're using.
    See the forum FAQ {message:id=9360002}

  • Multiple component renderer in the advanced datagrid in the same column

    Hi
    All I want is to render multiple Components in the same column based on the rowIndex value.
    Let me know if it is possible. Right now I am able to render the same components in the multiple rows in the same column.
    Example for further clarification:
    all in [] needs to be rendered as a compoennt
    Name  Component-to-be-renedered  Chart-component
    xyz       [ Combobox ]                        [piechart based on values]
    abc       [List]                                    [Column Chart based on value]
    Many Thanks,
    Piyush

    <mx:states>
      <mx:State name="firstComponentsSet">
       <mx:AddChild position="lastChild">
        <mx:Button />
       </mx:AddChild>
      </mx:State>
      <mx:State name="secondComponentsSet">
       <mx:AddChild position="lastChild">
        <mx:TextInput />
       </mx:AddChild>
      </mx:State>
             </mx:states>
    <mx:Script>
      <![CDATA[
      override public function set data(value:*):void {
       super.data = value;
       currentState = '';
       // if data requires firstComponetns set
       currentState = 'firstComponentsSet';
       // else
       currentState = 'secondComponentsSet';
      ]]>
    </mx:Script>

  • How to change background color in List of Values (LOV) ?

    Hiya
    In Forms 10g, the background color in list of values (LOV) is White whereas it was grey in Form 6i. Also, the position of 3 buttons i.e. Find, OK and Cancel on LOV is different than what it used to be in Forms 6i.
    Is it possible to change the background color and the position of buttons of LOV in Forms 10g ?
    Cheers
    Mayur

    I would like to share the outcome of this issue.
    I had posted this same issue on Metalink yesterday. They (Metalink guys) have confirmed that its an bug in Oracle 10g DS R2 and it would be fixed in subsequent releases.
    Following is an official response from Metalink:
    This issue has been addressed to Oracle Development to be investigated/fixed in the published Bug:
    Bug 1559776 <BACKGROUND COLOR SETTING FOR LOV OBJECT DOES NOT WORK ON WEB>
    Cheers
    Mayur

  • F4 help based on the records in the same column

    Dear All
    its an fantastic blog....i have one different question for u....n u can check the below..
    is it possible to get F4 functionality for a record in column in ALV based on the first 3 records of the same column....
    material vendor shipping contract
    2 4 6 -
    > 5(f4 help)
    3 2 4 6(f4 help)
    the contract value should only come based on the first 3 records of the coulumn and it shouldnt show any other value...other than combination values of first 3 records.....
    hope u got me know.....
    please let me know if you need further clarification....thanks in advance....
    Regards,
    Kartheek.....

    Hi Kartheek,
    do a where-used-list on function F4_INT_HELP_VALUE_REQUEST, start with B* programs.
    Or do a search on SCN and find [ABAP Code Sample to Attach F1 and F4 Help Fields in ALV Grid|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b3d5e890-0201-0010-c0ac-bba85ec2ae8d] and [view the code sample|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b3d5e890-0201-0010-c0ac-bba85ec2ae8d?quicklink=index&overridelayout=true].
    I hope your approved programming skills allow you to copy&paste.
    Regards.
    Clemens

  • I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    Hi Wayne,
    Thank you for this response.  I have tried this but when I start enterring $ amounts some, such as $6.00, go in OK others such as $4.00 appear as a date ie 4 Oct 12.  
    Kind regards
    Paul

  • How to change a selected cell background color in JTable?

    Hi all,
    I am trying to change the background color of a selected cell by clicking on that particular cell. DefaultTableCellRenderer class provides setBackground(Color c) to change the background color of unselected cells. Is there a way to change a selected cell background color?
    Thank you,
    Arthur

    Write your own renderer (eg. extending DefaultTableRenderer) and put in getTableCellRendererComponent method something like this:
    if( isSelected && hasFocus )
        setBackground( Color.RED );
        setForeground( Color.GREEN );
    }

  • How to display 2 lines in the same column header of jTable?

    Please could you help me to display 2 character lines in the same column header of a JTable?
    And how to make a fusion between to cells?
    Thank you very much

    In Swing, most components will accept text in the html format
    http://java.sun.com/docs/books/tutorial/uiswing/components/html.html
    You can then use <br> tags to make your header text multiline

  • Change a VI's background color

    how can I change a VI's background color ?

    If you're looking to change it programmatically, you can use property nodes.
    Drop a property node from the Application Control palette, right click on it and change the VI Server Class to VI. Next, change the Property to Front Panel, (not Front Panel Window). Now right click on the Panel output and create another property node for Color. Write to the Color property to change the panel color.
    The attached image shows these two nodes.
    Don�t forget to close the refnums.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    Change_panel_color.gif ‏2 KB

  • REPORT WITH CHANGING ITEM ON THE SAME COLUMN

    Hi to all,
    i'm trying to build a report with different item in the same column.
    Is that possible in any way using other Oracle technique?
    i'm not doing anything specific here, only i would like to know if the following possibility exist or not and how can i let apex render the htmldb_item fields 'dynamically'.
    Using this CODE inside a PL/SQL function body returning sql query I obtain the following report content. Such the code of htmldb_item.fields is written, as a field value the HTML_ITEM is not rendered, so only the description of them appear in the report.
    Does somebody know some tricks to make it work?
    Thanx a lot
    1     2     LAST_CALL     htmldb_item.date_popup (4, ROWNUM, FLD_VALUE,'dd/mon/yyyy') VALUE
    21     1     AGE     htmldb_item.text(4,FLD_VALUE,10,10) VALUE
    create or replace FUNCTION FNC_GEN_GUI_ITEM(ITEM_TYPE NUMBER) RETURN VARCHAR2 AS
    STRHTMLDITEM VARCHAR2(4000);
    BEGIN
    CASE ITEM_TYPE
    WHEN 1 THEN STRHTMLDITEM:=' htmldb_item.text(4,FLD_VALUE,10,10) VALUE ';
    WHEN 2 THEN STRHTMLDITEM:=' htmldb_item.date_popup (4, ROWNUM, FLD_VALUE,''dd/mon/yyyy'') VALUE ';
    END CASE;
    RETURN STRHTMLDITEM;
    END FNC_GEN_GUI_ITEM;
    MY TABLE AS FOLLOWS:
    CREATE TABLE "NEWPROJ"."DINFIELDGUI"
    (     "ID" NUMBER NOT NULL ENABLE,
         "FLD_TYPE" NUMBER,
         "FLD_NAME" VARCHAR2(4000 BYTE),
         "FLD_VALUE" VARCHAR2(4000 BYTE),
         CONSTRAINT "DINFIELDGUI_PK" PRIMARY KEY ("ID"));
    Message was edited by:
    Marcello Nocito

    Hi to all,
    i've solved, is very simple using decode inside the select:
    SELECT
    ID,
    FK_HTMLDB_ITEM, DECODE(FK_HTMLDB_ITEM,1,HTMLDB_ITEM.DATE_POPUP(3,rownum,VAL,'dd-mon-yyyy'),2,HTMLDB_ITEM.TEXT(3,VAL)) VALORE
    FROM TESTID
    my table is:
    CREATE TABLE "DEV"."TESTID"
    (     "ID" NUMBER NOT NULL ENABLE,
         "FK_HTMLDB_ITEM" NUMBER,
         "VAL" VARCHAR2(4000 BYTE))
    Bye Bye

  • ALV  List  in the same Column for the row  CELL  i need button or value

    Hi,
    In my ALV list  for the same column I need Button or  Value for the different rows (CELL) depending upon my condition.
    as well as I have to make  read only of 3 rd column CELL based on my first column dropdown value CELL for this Row Only.
    Depends upon the value in  column 1 /  row 2   I have to  read only  the CELL of   column 5 / row 2   ie for the same row.
    Depends upon the value in Column 1/ row 3    I have to   EDITABLE  or   Button   the CELL  of column 5 / row 3 ie for the same row
    How to do the logic for this.
    I tried and got it for the entire column only.
    But my requirement is for the sepecific cell in the column.
    Kindly help to proceed further.
    Thanks in advance.
    Dav

    Here is how you can make a particular cell in the row read-only based on certain conditions.
    In my example I am displaying the flight details in an ALV. Here I am checking the airline id and if it is "AA' I am making the cell in the column airline id as readonly. In my example I am putting a check and readonly on the same column. However you can do this for different columns as well.
    In order to achieve this you need to add a new context attribute 'READONLY' of type abap_bool to the context node which is bound to data node of ALV.
    The method where I populate the node has the following code to populate the data.
      data: lr_input_node type ref to if_wd_context_node,
            lr_flight_node type ref to if_wd_context_node,
            lv_cityfrom   type s_from_cit,
            lv_cityto     type s_to_city,
            ls_from       type bapisfldst,
            ls_to         type bapisfldst,
            lt_flights    type table of bapisfldat,
            ls_flights    type bapisfldat.
      data: lt_final type if_mainview=>elements_node_flighttab,
            ls_final type if_mainview=>element_node_flighttab.
    * Instantiate the variable lr_input_note to the node NODE_FLIGHT
      lr_input_node  = wd_context->get_child_node( name = 'NODE_FLIGHT' ).
    * Instantiate the variable lr_flight_note to the node NODE_FLIGHTTAB
      lr_flight_node = wd_context->get_child_node( name = 'NODE_FLIGHTTAB' )
    * Get the attributes CityFrom und CityTo
      lr_input_node->get_attribute( exporting name = 'CITYFROM'
                                    importing value = lv_cityfrom ).
      lr_input_node->get_attribute( exporting name = 'CITYTO'
                                    importing value = lv_cityto ).
    * Fill the stuctures ls_from and ls_to
      ls_from-city = lv_cityfrom.
      ls_to-city   = lv_cityto.
    * Call the function BAPI_FLIGHT_GETLIST
      call function 'BAPI_FLIGHT_GETLIST'
       exporting
         destination_from       = ls_from
         destination_to         = ls_to
       tables
         flight_list            = lt_flights.
    Now I am going to check if the airline id is 'AA' and based on that I will fill the readonly context attribute.
    loop at lt_flights into ls_flights.
        MOVE-CORRESPONDING ls_flights to ls_final.
        if ls_flights-airlineid = 'AA'.
          ls_final-readonly = abap_true.
        else.
          ls_final-readonly = abap_false.
        endif.
        append ls_final to  lt_final.
      endloop.
    Finally bind the data to the context node.
    * Bind the data to the node NODE_FLIGHTTAB
      lr_flight_node->bind_elements( lt_final ).
    Now you need to do the ALV configuration settings.
    * create an instance of ALV component
      DATA:
        lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.
      lr_salv_wd_table_usage = wd_this->wd_cpuse_alv( ).
      IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.
        lr_salv_wd_table_usage->create_component( ).
      ENDIF.
    * get ALV component
      DATA:
        lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
      lr_salv_wd_table = wd_this->wd_cpifc_alv( ).
      wd_this->alv_config_table = lr_salv_wd_table->get_model( ).
      CALL METHOD wd_this->alv_config_table->if_salv_wd_table_settings~set_read_only
        EXPORTING
          VALUE  = ABAP_FALSE
    * set visible row count
      DATA:
        lr_table_settings TYPE REF TO if_salv_wd_table_settings.
      lr_table_settings ?= wd_this->alv_config_table.
      lr_table_settings->set_visible_row_count( '10' ).
      DATA:
        lr_column_settings TYPE REF TO if_salv_wd_column_settings,
        lr_column          TYPE REF TO cl_salv_wd_column.
      lr_column_settings ?= wd_this->alv_config_table.
      DATA: lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
      lr_column = lr_column_settings->get_column( 'AIRLINEID' ).
      CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'AIRLINEID'.
      lr_column->set_cell_editor( lr_input_field ).
      lr_input_field->set_read_only_fieldname( value = 'READONLY' ).
      CALL METHOD lr_column_settings->delete_column
        EXPORTING
          id     = 'READONLY'

  • Formula to Calculate Cell Above in the Same Column?

    How do you write a formula that looks if two cells (with dates) are identical in the same column; and if they are not identical, subtract 1 day from the date in the above cell to determine the date for the cell below it.
    =IF($A1=$A2,B1-1,B2+28)

    How do you write a formula that looks if two cells (with dates) are identical in the same column; and if they are not identical, subtract 1 day from the date in the above cell to determine the date for the cell below it.
    =IF($A1=$A2,B1-1,B2+28)

  • Different ItemRenderer's in the same column of a datagrid

    I am using actionscript to read some XML input and dynamically add data into the datagrid.
    Currently I am reading the first row and depending on the data type of the coulmn i am creating the column to be a IntemRenderer of Image, or Link button.
    Now is there anyway of adding some rows to be LinkButton ItemRenderes and some to be Image ItemRenderers, in the same column?
    Any examples are also appreciated

    You can try overriding createColumnItemRenderer
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Does not do the sorting if I click twice to the same column.

    Hello
    I am new to winforms.
    I have a listview. I want it to toggle the sorting of the records of the listview when the columns are clicked
    Please guide me as to how to do the same.
    The code that I have attached does not do the sorting if I click twice to the same column. I have to click a different column ten the previous column 
    The code is attached below
    regards
    Manoj Gokhale
    private void SiteInChargeorSupervisor_Load(object sender, EventArgs e)
    this.listView1.ColumnClick += new ColumnClickEventHandler(listView1_ColumnClick);
    private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
    ListViewSorter Sorter = new ListViewSorter();
    listView1.ListViewItemSorter = Sorter;
    if (!(listView1.ListViewItemSorter is ListViewSorter))
    return;
    Sorter = (ListViewSorter)listView1.ListViewItemSorter;
    if (Sorter.LastSort == e.Column)
    if (listView1.Sorting == System.Windows.Forms.SortOrder.Ascending)
    listView1.Sorting = System.Windows.Forms.SortOrder.Descending;
    else
    listView1.Sorting = System.Windows.Forms.SortOrder.Ascending;
    else
    listView1.Sorting = System.Windows.Forms.SortOrder.Descending;
    Sorter.ByColumn = e.Column;
    listView1.Sort();
    public class ListViewSorter : System.Collections.IComparer
    public int Compare(object o1, object o2)
    if (!(o1 is ListViewItem))
    return (0);
    if (!(o2 is ListViewItem))
    return (0);
    ListViewItem lvi1 = (ListViewItem)o2;
    string str1 = lvi1.SubItems[ByColumn].Text;
    ListViewItem lvi2 = (ListViewItem)o1;
    string str2 = lvi2.SubItems[ByColumn].Text;
    int result;
    if (lvi1.ListView.Sorting == System.Windows.Forms.SortOrder.Ascending)
    result = String.Compare(str1, str2);
    else
    result = String.Compare(str2, str1);
    LastSort = ByColumn;
    return (result);
    public int ByColumn
    get { return Column; }
    set { Column = value; }
    int Column = 0;
    public int LastSort
    get { return LastColumn; }
    set { LastColumn = value; }
    int LastColumn = 0;

    Every time through the ColumnClick event handler, you are creating a new sorter. This means that any values set in the sorter from the previous click are not saved.
    Try this.
    private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
    // Only create a new sorter if we don't have one already.
    if(listView1.ListViewItemSorter == null)
    ListViewSorter Sorter = new ListViewSorter();
    listView1.ListViewItemSorter = Sorter;
    // And so on with the rest of your code.

  • Datagrid scrolling problem when different items are in the same column

    I have a datagrid which I am populating with different items (LinkButtons, Images, Labels). However when there are different types of items in the same column and when i try to scroll everything gets messed up (Images get overlapped with each other or the labels get overlapped with images).
    I am overloading the "IDropInListItemRenderer" to create different types of items in each cell and I am overloding the "updateDisplayList" function
    Any ideas as to why the items get messed up during scrolling? Is there some other preperty of IDropInListItemRenderer that should be overloaded?

    Hi Subeesh Arakkan,
    Thanks. This is the exact problem that I have. Althought my overloaded functions are a little different and Im trying to resolve it. But htis is a good lead.
    Thanks,
    Prashanth

Maybe you are looking for

  • DO NOT BUY IPODS FROM FUTURESHOP OR BEST BUY

    The warranty policy for both are ridiculous. They charge the same amount as Apple does. Get this, they don't even touch any ipods that need service for the first year. On top of that, any repairs that are made to the IPOD after the one year manufactu

  • How does GPS in iPhone 4 & 4S work?

    I am an AT&T 2GB data connection subscriber and will be cross-province touring in Quebec, Canada. I am debating on whether to get a portable GPS receiver or use my iPhone to get directions and map layout. Does the iPhone GPS require data connection t

  • Wireless connection falls asleep..

    So when the tv goes on standby (screensaver active, not been used for X hrs), then come back to use it, it often drops off the network. All the other wireless stuff (iBook, MBP, PCs, iPhones etc) are still running fine, and connected without probs.

  • Want to make phone calls via bluetooth on my iPhone from iPad

    I can link my Garmin GPS to my iPhone via Bluetooth and make or receive phone calls. I would like an iPas app that provides the sametype functionality including: Make calls Receive calls Look uphone numbers Is this possible?  Using what app?

  • Do I proceed or give up?

    I need advice from people in the know, which obviously, I'm not one of. I'm a long time Novell devotee, but 2 years ago went to the dark side and installed a Windows SBS 2003 server and used it for some time for my little business (5 user maintenance