Solved

Changing background color of a cell (Field) - Crystal Report

Posted on 2012-04-02
8
3,140 Views
Last Modified: 2012-06-27
Hi,

I have two columns:

Column_Value            Column_Display
          1                                  W
          2                                  W
                                              Y
                                              Y

Whenever the value of the column "Column_Display" = "Y" then i want to display the background color of the "Column_Value" cell in "Yellow" color otherwise in "White" color.

Note that for the column "Column_Display" there may or may not be a corresponding value existing in "Column_Value". Can you please provide me the steps to do this task ?

Thanks
0
Comment
Question by:milani_lucie
  • 4
  • 3
8 Comments
 
LVL 13

Assisted Solution

by:Ashok
Ashok earned 250 total points
ID: 37797363
Try

Step #1 : Right-click on the field Column_Value and select Format Field.
Step #2 : Click on the "Font" tab.
Step #3 : Click on the "x-2" (formula) button next to BackgroundColor.
Step #4 : Use the following fomula: if Column_Display = "Y" then crYellow else crWhite
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 37797369
Try this

Assumes this is the details so the values are in the same record.

Right click the field
Click FORMAT FIELD
Click the BORDER tab
Click the formula button to the right of BACKGROUND

If {Column_DisplayField} = 'Y' then
    crYellow
Else
    crWhite

mlmcc
0
 

Author Comment

by:milani_lucie
ID: 37797376
I have tried in that way. But it is not working as expected.

Thanks
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:milani_lucie
ID: 37797382
Background color is not working for rows 3 and 4.

Thanks
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 37797530
Is the field NULL?
If so you will have to use a formula for the field so the report puts something there

Something like


If IsNull({ColumnField}) then
   ' '
Else
   {ColumnFIeld}

mlmcc
0
 

Author Comment

by:milani_lucie
ID: 37797692
Its EMPTY string in both the rows which is coming from the database.

Thanks
0
 

Author Comment

by:milani_lucie
ID: 37797695
For Column_Value - Thanks
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 37799118
You can try

If IsNull({ColumnField}) OR {ColumnField} = "" then
   '  '
Else
   {ColumnFIeld}

FOrthe formatting to work you hav eto get the field to put something in the field.  Null or empty string won't trigger the formatting

mlmcc
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question