By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,658 Members | 1,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,658 IT Pros & Developers. It's quick & easy.

Dynamically change background color in Crystal Reports.Net

P: n/a
I have a Crystal Reports.Net report being generated from my C#
application. I would like to change the background color of the
details section (not the text mind you) of the report on certain
conditions. For example if the value of the 'Meeting Number' is
greater than 100 the background color of the details section will be
light yellow, otherwise it will be white. There will be multiple
records in this reports so one (or a few) detail section might be
yellow while all others on the page are white; or vice versa. I could
either change the color of the background section to yellow or possibly
create a yellow rectangle around the section and turn it
visible/invisible at runtime depending on the value of my field.

Does anyone have any ideas on how I can accomplish this?

TIA,

ngpost1

Sep 6 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

ng*****@hotmail.com wrote:
I have a Crystal Reports.Net report being generated from my C#
application. I would like to change the background color of the
details section (not the text mind you) of the report on certain
conditions. For example if the value of the 'Meeting Number' is
greater than 100 the background color of the details section will be
light yellow, otherwise it will be white. There will be multiple
records in this reports so one (or a few) detail section might be
yellow while all others on the page are white; or vice versa. I could
either change the color of the background section to yellow or possibly
create a yellow rectangle around the section and turn it
visible/invisible at runtime depending on the value of my field.

Does anyone have any ideas on how I can accomplish this?

TIA,

ngpost1
I found a way to do this - kinda.

I added a new field to my report's DataSet called Highlight. I added
that field to my report and set the background color, border and text
color all to be light yellow. I set the SupressIfZero property to
True. At runtime, I loop through the DataSet and if Meeting Number is
greater than 100 I set the value of the Highlight field to X otherwise
I set it to and empty string.

When the report is rendered if the Highlight field is not empty (per
the SupressIfZero setting) it will be displayed; otherwise it is
suppressed. Because the border color, background color and text is all
the same color it just looks like a yellow box around everything.

ngpost1

Sep 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.