Monday, March 26, 2012
Getting #Error with aggregate function
=Sum(IIf(Fields!GroupCode.Value = 10, Fields!Rating.Value, 0))
I am getting #Error as the value. This however gives me a value:
=Sum(IIf(Fields!GroupCode.Value = 10, 1, 0))
However, I need the above to work...I need it to sum the rating if it's
part of a particular group.Here are some additional findings...
The following code works:
=Sum(IIf(Fields!GroupCode.Value = 10, CInt(Fields!Rating.Value), 0))
The following code fails:
=Sum(IIf(Fields!GroupCode.Value = 10, 1.20, 0))
=Sum(IIf(Fields!GroupCode.Value = 10, CDbl(Fields!Rating.Value), 0))
Why is it that it can only sum up intergers?|||I figured it out!!
The following code works:
=Sum(IIf(Fields!GroupCode.Value = 10, 1.20, 0.0))
Both the true and false values need to be of the same type. By return
0 as my false condition value, and 1.2 as my true condition, it caused
it to fail because it's returning different data types base on the
different condition.
This is bad, MS needs to fix this.
Monday, March 19, 2012
Get value of 10 textboxes to decide footer color
If I have the 10 textboxes in my footer with a value of "X" (from an IIF() expression), then I would like to alert the users and have the footer a different color.
I'm trying to get the value of the textbox, but keep getting an error of it being undeclared. I'm trying different syntax, but can't get it to work.
Here's the code:
=
IIF(
textbox11 ="X" or textbox15="X" or textbox19="X" or textbox27="X" or textbox23 = "X" or textbox31 = "X" or textbox35 = "X" or textbox39 = "X" or textbox43 = "X" or textbox47 = "X"
,"Gainsboro","Transparent")
How do you accomplish this in RS for SQL 2000?
Jason|||You need to use the ReportItems collection:
IIF(
ReportItems!textbox11.Value ="X" or ReportItems!textbox15.Value="X" or ReportItems!textbox19.Value="X" or ReportItems!textbox27.Value="X" or ReportItems!textbox23.Value = "X" or ReportItems!textbox31.Value = "X" or ReportItems!textbox35.Value = "X" or ReportItems!textbox39.Value = "X" or ReportItems!textbox43.Value = "X" or ReportItems!textbox47.Value = "X"
,"Gainsboro","Transparent")|||That seems to get me closer, but it still doesn't get me past the scope issue. I've moved my post to a seperate thread with a more detailed description of what I'm trying to do.
Jason