开发者

Crystal Reports 2008 - Changing background color

开发者 https://www.devze.com 2023-03-12 01:43 出处:网络
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.

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.

Crystal Reports 2008 - Changing background color

If If WorkID IS NOT equal to or null to the Technical.workId or the Development.WorkId, the my report is blank.

Crystal Reports 2008 - Changing background color

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开发者_如何学C 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


You have to explicitly check for null using isnull otherwise the formula gives up.


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

Hope this helps,

Joven

0

精彩评论

暂无评论...
验证码 换一张
取 消