Crystal Reports 2008 - 更改背景颜色

时间:2011-06-07 15:34:03

标签: crystal-reports crystal-reports-2008

我有一个子报表,在Group Footer中,我有字符串,我正在尝试使用以下代码更改背景颜色。

如果WorkID等于Technical.workId或Development.WorkId,则颜色代码有效,但其他项目为纯黑色。

Example 1

如果WorkID不等于或等于Technical.workId或Development.WorkId,则我的报告为空白。

Example 2

if 
{?Pm-DB.ID}={Work.Num} 
and {Work.WorkID}<>{Technical.workId}
and {Work.WorkID}<>{Development.WorkId} Then crNoColor
else if
(
{?Pm-DB.ID}={Work.Num} 
and {Work.WorkID}={Development.WorkId} 
and {Development.PlanName}={Project.ProjectName}
and {Development.devStatus} = "R" )
then crRed
else if (
{?Pm-DB.ID}={Work.Num} 
and {Work.WorkID}={Development.WorkId} 
and {Development.PlanName}={Project.ProjectName}
and {Development.devStatus} = "A" )
then crYellow
else if (
{?Pm-DB.ID}={Work.Num} 
and {Work.WorkID}={Tech.workId}
and ({Resource.Team Name}like "Tech*") 
and {Technical.TechStatus} = "R" )
then crRed
else if (
{?Pm-DB.ID}={Work.Num} 
and {Work.WorkID}={Tech.workId}
and ({Resource.Team Name}like "Tech*") 
and {Technical.TechStatus} = "A" )
then crYellow
else if (
{?Pm-DB.ID}={Work.Num} 
and {Work.WorkID}={Tech.workId}
and ({Resource.Team Name}like "QA*") 
and {Technical.TechStatus} = "R" )
then crRed
else if (
{?Pm-DB.ID}={Work.Num} 
and {Work.WorkID}={Tech.workId}
and ({Resource.Team Name}like "QA*") 
and {Technical.TechStatus} = "A" )
then crYellow

2 个答案:

答案 0 :(得分:0)

您必须使用isnull明确检查null,否则公式会放弃。

答案 1 :(得分:0)

我认为如果你不想为空白记录着色,你需要你声明中的其他部分才能使用它。只需在你的else语句中包含crNone或crWhite

希望这有帮助,

的Joven