Solved

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

Posted on 2012-04-02
8
3,051 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
 

Author Comment

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

Thanks
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
I do a File --> Open and Crystal just sits there 5 57
Execute a crystal report from vb2010 3 39
Crystal Report Filter Question 6 58
Pull date to Group header 6 26
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now