SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Custom Code with AND
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sz1
Constraint Violating Yak Guru

United Kingdom
443 Posts

Posted - 04/23/2013 :  03:51:51  Show Profile  Reply with Quote
IS it possible to add the AND clause to a piece of custom code in the Font colour expression, so

=Code.fnGetConditionalColor(Fields!Agreed_Solved_Date___Time.Value AND(Fields!Within_Flag = "1")

Thanks

SZ1
Learning and development is the driving force in the universe...!

James K
Flowing Fount of Yak Knowledge

3717 Posts

Posted - 04/23/2013 :  08:34:29  Show Profile  Reply with Quote
You can - probably this?
=Code.fnGetConditionalColor(Fields!Agreed_Solved_Date___Time.Value)  AND(Fields!Within_Flag = "1"


Go to Top of Page

sz1
Constraint Violating Yak Guru

United Kingdom
443 Posts

Posted - 04/23/2013 :  09:43:22  Show Profile  Reply with Quote
Yeah thats coming back as black only? here is the function that works the colour out, I added this to all the font expressions. Wonder if I can add the AND(Fields!Within_Flag = "1" statements to each of the color parts here?





Public Function fnGetConditionalColor(pDate as datetime) AS String

Dim d AS integer
Dim c as string
d= DateDiff("d", pDate.Date, Now.Date)
IF d<0 and (Fields!Within_Flag = "0"
THEN
c="Green"
ELSE IF d =0 and d <=1 and (Fields!Within_Flag = "1" THEN
c="Red"
ELSE
c="Blue"
END IF

Return c

End Function

SZ1
Learning and development is the driving force in the universe...!

Edited by - sz1 on 04/23/2013 09:44:38
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000