Jasper Export to excel: changing background color of the cell/field

Hi all,
I have designed a report containing a set of 5 different fields. All these are STRING values.
Among these are two fields named: BUDGETED and ACTUAL.
I want to show the data corresponding to ACTUAL in red color if the value of ACTUAL is greater than BUDGETED when exported in excel format.
The value itself should be displayed in red color or the excel cell should have a color red
Can someone please help me in this? How can we implement the logic to compare these two values?
Thanks in advance.

You are using Jasper and you thought: hey, let me post a question in the Oracle Reports forum?

Similar Messages

  • Background color of the cell in EXCEL not working....Pls help..

    Hi gurus,
    I have written a procedure to change the background color of the cell in EXCEL.The code is as below..
    PROCEDURE set_header     (p_row IN NUMBER, p_col IN NUMBER, p_value IN VARCHAR2, p_border IN VARCHAR2 DEFAULT 'N',p_bgcolor IN VARCHAR2 DEFAULT 'N') IS
    BEGIN
         v_args     := ole2.create_arglist;
         ole2.add_arg(v_args, p_row);
         ole2.add_arg(v_args, p_col);
         v_cell     := ole2.get_obj_property(v_worksheet, 'cells', v_args);
         v_font     := ole2.get_obj_property(v_cell, 'font');
         ole2.set_property(v_font, 'fontstyle', 'bold');
         ole2.set_property(v_font, 'size', 9);
         ole2.destroy_arglist(v_args);
         if p_border = 'Y' THEN
              v_border := ole2.get_obj_property(v_cell, 'Borders');
              ole2.set_property(v_border, 'LineStyle', 1);
              ole2.release_obj(v_border);
         End If;
         if p_bgcolor ='Y' THEN
              v_bgcolor := ole2.get_obj_property(v_cell,'Bgcolor'); --This is not woking
              ole2.set_property(v_bgcolor,'bgcolor','red');
              ole2.release_obj(v_bgcolor);
         End If;
              ole2.set_property(v_cell, 'value', p_value);
              ole2.release_obj(v_cell);
         END set_header;
    Pls tell me how to change the backcolor and forecolor in the cell...
    Thanks

    The background color is set for the "Interior" object of the selected cells (Range).
    Try something like this (haven't tested it):
    v_interior := ole2.get_obj_property(v_cell,'Interior');
    ole2.set_property(v_interior,'ColorIndex',3); --should be red
    ole2.release_obj(v_interior);
    If the Foreground color = Font Color then
    ole2.set_property(v_font,'ColorIndex',6); --should be yellow
    Gerald

  • Export to Excel Issue - Background Colors

    Hi,
    I have upgraded report server from 2005 to 2008R2. I have an issue where in my code 2 separate reports are output into Excel. When this happens the background color is a random bright color such as green and yellow.
    I tried creating a new report in the same solution but I get the same issue. I also tried setting colors in report to just black & white but no change.
    I found
    this KB but does not help in my situation as no manual copy/paste.
    Any ideas? Thanks!
    string differencesFile = "myfilepath";
    Excel.Application xlApp;
    Excel.Workbook finalWorkbook;
    Excel.Workbook xlWorkbook;
    Excel.Worksheet balancesWorksheet;
    Excel.Worksheet differencesWorksheet;
    Excel.Worksheet newWorksheet;
    object missing = System.Reflection.Missing.Value;
    xlApp = new Excel.ApplicationClass();
    xlWorkbook = xlApp.Workbooks.Open(differencesFile, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
    differencesWorksheet = (Excel.Worksheet)xlWorkbook.Sheets[1];
    finalWorkbook = xlApp.Workbooks.Add(missing);
    newWorksheet = (Excel.Worksheet)finalWorkbook.Sheets.Add(missing, missing, missing, missing);
    differencesWorksheet.Copy(missing, newWorksheet);
    xlWorkbook.Close(false, differencesFile, false);

    Hi obrienkev,
    In order to trouble shoot this issue more efficiently, could you tell me what’s the function of this code you posted? What do you want to do with this code? Could you explain it more details?
    As to your issue, please try to directly export the report to Excel to check this issue again. Are you get the correct background color in the report or with the same issue? Tell us more detail information, then we can make further analysis.
    Thank you for your understanding.
    Regards,
    Katherine xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Change background color of the message pane

    Morning.
    Is it possible to change the background color of the message pane in the Mail.app main window? I'ld like to have an light yellow background because the white background is too lurid.
    TIA and kind regards, Friedrich

    that's not not possible.

  • Change font color in the Text Field of a Popup Key LOV

    Hello,
    I have a question concerning Popup Key LOV.
    I want to change the font color in the Text Field of the Popup Key LOV Item.
    I searched the forum but I cannot find an answer about this! Although I searched the CSS and the Popup Key LOV Template, but I do not know where to modify the font color.
    Has anyone an idea how to solve that problem?
    Regards,
    Tim

    Hey,
    thank for your reply!
    I use style="color:#000000;" and it work in Firefox, but not in Internet Explorer 7.0!
    And that is not the first time, that there are differences in displaying those tags in the HTML Form Element Attributes and in css files, etc.
    Does anybody know I to solve that?
    Thank you,
    Tim

  • How can I change background color of the cover in ibooks Author?

    I'm trying to change the color of the background of the cover of the iBook I'm creating. I can't find how to.
    Please help.
    Gaby

    Gaby -
    Click on Book Title, unlock it, delete.
    Select a square graphic, turn Object causes wrap off.
    Make the square any color you like.
    Enlarge it to cover the page.
    Send to back. Lock it down.
    That's it.
    Now go here and download this free book, Publishing With iBooks Author, from O'Reilly press.
    http://shop.oreilly.com/product/0636920025597.do?sortby=publicationDate
    - Fabe

  • How can I change background color for a text field

    Hi I tried this
    style="BACKGROUND-COLOR:#00FFFF"
    working fine in IE
    but not working in Netscape.. any other way to set the background color?

    Netscape 4.x does not support this feature. Only Netscape 6.x does.

  • How to change background color of multilevel textbox in oracle form 6i

    hi
    How To Change background Color of the Text.
    In One Multilevel Block 10 Record is Display At a Time in a Text Box (Name is AMTt)
    This Text Box display , Buffer and Record Length is 10
    In Case Of Amount is Less 500 then Text Color Is Red(Or Any) and In Case Amount Is More 500 Then Color is Green (Or Any).
    Me Use This Code in PRE_RECORD EVENT
    TCMTL is Block name
    TCMTL_AMT is Text Box Name
    if :TCMTL.TCMTL_AMT >5000 then
         g_fun.msgbox('Values is more');
         Set_Item_Property('TCMTL_AMT' , BACKGROUND_COLOR, 'r50g100b100');
    else
         g_fun.msgbox('Values is Less');
         Set_Item_Property('TCMTL_AMT' , BACKGROUND_COLOR, 'r50g100b10');
    end if;     
    but This Code Is Refer Only 10th Value and change color depend on value.
    so
    possible to Different color in One Block Text Box Then how?

    DECLARE
         cur_itm VARCHAR2(80);
         cur_block VARCHAR2(80) := Name_in('system.trigger_block') ;
         BEGIN
         cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
    WHILE ( cur_itm IS NOT NULL ) LOOP
              cur_itm := cur_block||'.'||cur_itm;
              --:global.VISUAL_ATTRIBUTE:= 'BACKGROUND_COLOR';
              --:global.VISUAL_ATTRIBUTE:= get_item_property(cur_block||'.'||cur_itm ,Background_Color);
              IF :TCMTL.TCMTL_AMT >= 500 THEN
                             Set_Item_Instance_Property( cur_itm, CURRENT_RECORD, VISUAL_ATTRIBUTE,'r50g100b100');
                   ELSE
                             Set_Item_Instance_Property( cur_itm, CURRENT_RECORD, VISUAL_ATTRIBUTE,'r5g100b10');
                   END IF;
                             cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
                   END LOOP;
                   next_record;
    END;
    this is my in that how to set a VISUAL_ATTRIBUTE, and where to set so get a background color of text and change

  • How to control background color of table cell in an html report?

    I am using Labview 6.1 to generate a report.  In that report there is a table created using the Append Numeric Table to Report VI.  I want to be able to programmatically control the background color of each cell in the table.  Also, how can I programmatically control the background color of the row and header cells of the same table.  I am also generating a second table in the same report using the Append Text Table to Report VI and I would like to programmatically control the background colors of the cells in that table as well.  Thanks.

    Hi epsilon-d...,
    i´m not sure if there is an ready to use function to do what you want, but you can enlarge the available function. Open the "Append Numeric Table to Report.vi" and go to the HTML Case. There you can see another vi which creates the html table. In the VI "HTML Report Table Row" you can add the option: bgcolor="your color" inside of the "TR" tag.
    Hope it helps.
    Mike

  • Add background color to the summary row in the standard report

    Hi All,
    I have a standard SQL report that have the sum at the bottom of the report by checking the compute sum. How do I add the background color to that row.
    Would you please help?
    I use APEX version 4.0.1
    Thanks,
    Nina

    Hi Nina,
    Take a look at the example at http://apex.oracle.com/pls/apex/f?p=50942:91. It is using the static ID attribute "MYTABLE" and conditionally applying background color to the cell which contains the text "Report Summary".
    <script>
    //Report Summary
    $("#MYTABLE tbody tr td table tbody tr td:contains('Report Summary')").each(function(){
      $(this).parent('tr').children().css("background-color","#FFFF33"); ;
    </script>Thanks,
    Manish

  • Is there a way to change the WHITE background color of the photo gallery/COLLECTIONS to BLACK.  IPad 4 ios 7

    As a Professional Photographer, I chose to buy an IPad 4 for only one reason and that was the amazing color and clarity of the Photo Gallery as a mobile Portfolio.
    Originally the background color of the IPad 4 Gallery was BLACK and this facilitated the photos greatly, photos look better and stand out better on a BLACK background. White backgrounds cause a glare eminating from the edges of the photo and cause iris in our eyes to close down, degrading the quality of the photo being viewed.
    I updated to ios 7 and now my IPad 4 has a WHITE background, which is unacceptable for viewing photos.
    HOW DO I CHANGE the WHITE background on the Photo/Gallery/COLLECTIONS to BLACK?
    Apple should ALWAYS give USERS/OWNERS of their products control of such details. IT'S JUST GOOD CUSTOMER SERVICE!

    Vancouver22  Thanks for your help... the SLIDESHOW turned black for me automatically when the slideshow began. That works most excellent!
    Now if I can just get the White Background to STAY BLACK, this might not be as painful as I feared.
    My IP4 does lag slightly, but not enough to set fire to it yet.
    The gallery/COLLECTIONS/ALBUMS are the most important thing to me.
    Thanks!
    Jon Dize aka DIZEMAN   (Not quite BATMAN, but whatchagonnado?}
    [email protected]
    http://dizeman.com/  (Bio)
    http://dizeman.com/rock&roll/   (Rock Stars Clients/Subjects)
    http://dizeman.com/glamour/    (Playboy Centerfold Shoots)
    http://dizeman.com/thisnthat/   (Just stuff I shot on the way to stuff to shoot.)

  • Change the background color of a particular word without changing the background color of the rest of the text in a textbox

    Hello,
    I'm designing my own website and want to know how to change the background color of a particular word without changing the background color of the rest of the text in a textbox. If i can't do this, how can I create a Table, similar to Excel with iWeb?
    Thank you very much!
    Roger.

    If i can't do this, how can I create a Table, similar to Excel with iWeb?
    Read this :
         Create and add a TABLE in iWeb »
         More about a TABLE in iWeb »
         Sample 1
         Sample 2

  • How to change the background color of a cell based on other cell background

    Hi,
    Sorry if this is a basic question - I am new to XML. I want to create a table column, with no data in it. I then want to change the background color of the column based on the background color of other columns. I.E.
    - If there are 3 or less cells in this row that are not green, color this cell green.
    - If there are 4 or less cells in this row that are not green, and 3 or less are not red, color this cell yellow.
    - If there are 4 or less cells in this row that are not green, and 3 or more are red, color this cell red.
    If there are 5 or more cells in this row that are not green, color this cell red.
    Many thanks for any assistance.

    Okay - I have this resolved.
    1. Create two variables (Yellow and Red):
    <?xdoxslt:set_variable($_XDOCTX, 'Yellow', 0)?>
    <?xdoxslt:set_variable($_XDOCTX, 'Red', 0)
    2. For each cell, set the background based on their individual traffic light criteria, and update the associated color variable by 1. By default the backgrd color is set to Yellow so I only have to check for the lower and upper bounds:
    <?choose:?>
    <?when:number(CHECKED_IN)<=1?>
    <?attribute@incontext:background-color;'Lime'?>
    <?end when?>
    <?when:number(CHECKED_IN)>3?>
    <?attribute@incontext:background-color;'Red'?>
    <?xdoxslt:set_variable($_XDOCTX, 'Red', xdoxslt:get_variable($_XDOCTX, 'Red') +1)?>
    <?end when?>
    <?otherwise?>
    <?xdoxslt:set_variable($_XDOCTX, 'Yellow', xdoxslt:get_variable($_XDOCTX, 'Yellow') +1 )?>
    <?end otherwise?>
    <?end choose
    3. I now want a cell that is Red if any of the cells in the row is red. Its yellow of there are 3 or more yellow cells in the row, and no reds. Otherwise its green. First, create an empty cell and make the default color green. Then add:
    <?if: number(xdoxslt:get_variable($_XDOCTX,'Red')) > 0?>
    <?attribute@incontext:background-color;'Red'?>
    <?end if?>
    <?if: number(xdoxslt:get_variable($_XDOCTX,'Yellow')) >= 3 and number(xdoxslt:get_variable($_XDOCTX,'Red')) = 0?>
    <?attribute@incontext:background-color;'Yellow'?>
    <?end if?>
    4. Finally, reset the variables for the next row:
    <?xdoxslt:set_variable($_XDOCTX, 'Yellow', 0)?>
    <?xdoxslt:set_variable($_XDOCTX, 'Red', 0)

  • How can I change the background color in the inbox?

    The background color in my inbox (well, all mailboxes) is white. A yellow background would make the existing black text a lot easier to read. How can I change the background color in the inbox?

    Themes work in Thunderbird - duggabe was not refering to Firefox.
    Another useful addon is theme and font changer:
    * https://addons.mozilla.org/fr/thunderbird/addon/theme-font-size-changer/
    However, Thunderbird allows you to modify all sorts of things.
    Make hidden files and folders visible:
    * http://kb.mozillazine.org/Show_hidden_files_and_folders
    Help > Troubleshooting Information
    Click on 'show Folder' button
    a window opens shwoing profile folder name
    Close Thunderbird now - this is important
    In the profile name folder, Create a new folder called '''chrome''' - note the spelling
    It should be in the same place as the 'Mail' folder.
    see first image below.
    Open Notepad
    Can be located : Start > Programs > accessories
    Copy everything shown between the lines below.
    Paste into Notepad.
    Save as '''userChrome.css''' - note the spelling (edit updated - this was a typo error)
    This should be saved in the '''chrome''' folder.
    see second image below.
    Restart Thunderbird.
    I have chosen a yellow for you
    <pre>
    #f6f58c = a yellow....it is a hex code for a colour.
    </pre>
    You can change it if required. Remember when updating anything in the profile folders, you must close Thunderbird first.
    More info on colours.
    * http://www.yourhtmlsource.com/stylesheets/namedcolours.html
    <pre>
    * Do not remove the @namespace line -- it's required for correct functioning
    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
    /*Background colour for message list*/
    #threadTree > treechildren::-moz-tree-row {
    background-color: #f6f58c !important;
    </pre>
    -------------------------------------------

  • How to change the Background color of a cell in JTable

    hi!
    Actually i want to change the background color of few cells in JTable
    is there any method to make this change in JTable ?
    and also is it possible to have 5 rows with single column and 5 rows with 3 columns in a single JTable

    i want to change the background color of few cells in JTableDepending on your requirements for the coloring of cells it may be easier to override the prepareRenderer() method of JTable:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=610474

Maybe you are looking for