简体   繁体   English

Crystal Reports 2008 - 更改背景颜色

[英]Crystal Reports 2008 - Changing background color

I have a subreport, and in the Group Footer, I have string, that I am trying to change the background color using the following code.我有一个子报表,在组页脚中,我有字符串,我正在尝试使用以下代码更改背景颜色。

If WorkID IS equal to the Technical.workId or the Development.WorkId, then the color code works, but the other items are solid black.如果 WorkID 等于 Technical.workId 或 Development.WorkId,则颜色代码有效,但其他项目为纯黑色。

示例 1

If If WorkID IS NOT equal to or null to the Technical.workId or the Development.WorkId, the my report is blank.如果如果 WorkID 不等于 Technical.workId 或 Development.WorkId 或 null,则我的报告为空白。

示例 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

I think you need an else part of your statement to able to work that, if you dont want to color the blank record.. just include crNone or crWhite on your else statement我认为你需要你的语句的一个 else 部分才能工作,如果你不想为空白记录着色.. 只需在你的 else 语句中包含 crNone 或 crWhite

Hope this helps,希望这可以帮助,

Joven少年

You have to explicitly check for null using isnull otherwise the formula gives up.您必须使用isnull明确检查 null 否则公式放弃。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM