Solved

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

Posted on 2012-04-02
8
3,408 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 101

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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

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

Thanks
0
 
LVL 101

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 101

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

695 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