Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Background Color Main and Sub Report Post Reply Post New Topic
Author Message
dkpayroll
Newbie
Newbie
Avatar

Joined: 27 Jun 2013
Location: United States
Online Status: Offline
Posts: 1
Quote dkpayroll Replybullet Topic: Background Color Main and Sub Report
    Posted: 27 Jun 2013 at 6:16am
I am working on a Crystal Report using a Sub Report. 
I am wanting to insert a background color using the criteria in both the main report and sub report.  For instance:
 
if Main Report field >= 1000 and Sub Report field is <= 5 then cryellow
else crwhite
 
How can I make this happen?
 
Thanks
IP IP Logged
praveeng
Senior Member
Senior Member
Avatar

Joined: 11 Jul 2011
Online Status: Offline
Posts: 165
Quote praveeng Replybullet Posted: 27 Jun 2013 at 9:49am

Hi

To acheive your requirement you need to use Shared variable concept.
To access a value in sub-report through shared variable we need to do following steps:
Create a formula in Main report as
Shared NumberVar sh:= {Main Report filed};
sh;
 
Go in to Sub report and Right click on the section you want to change the background color and select Section Expert > select the section and select Color  tab
then click on formula tab, in that write below logic
 
Shared NumberVar Sh;
if sh >=1000 and Sub Report field is <= 5 then CrYellow
else
CrWhite;
 
P.S: if you want to apply background color to Main report then you need to create the shared variable in Sub report and need to write the back ground color logic in Main reports section expert's Color tab.
 
Praveen Guntuka,
praveen_guntuka@yahoo.com
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.