Solved

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

Posted on 2012-04-02
8
2,979 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
Comment Utility
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
Comment Utility
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
Comment Utility
I have tried in that way. But it is not working as expected.

Thanks
0
 

Author Comment

by:milani_lucie
Comment Utility
Background color is not working for rows 3 and 4.

Thanks
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
Comment Utility
Its EMPTY string in both the rows which is coming from the database.

Thanks
0
 

Author Comment

by:milani_lucie
Comment Utility
For Column_Value - Thanks
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 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

12 Experts available now in Live!

Get 1:1 Help Now