sorry it didn't encapsulate the code snippets.
Here it is again:
Report Properties.Code
Private LowVal as Decimal, HighVal as Decimal
Function SetHeatMapRange (LowValue as Decimal, HighValue as Decimal) As Object
LowVal = LowValue
HighVal = HighValue
End Function
Function HeatMapColor (ThisValue As Decimal) As String
Dim OutR As Byte, OutG As Byte, OutB As Byte
OutB = 0
OutR = 255 – ((ThisValue – LowVal) / (HighVal – LowVal)) * 255)
OutG = 255 * (((ThisValue – LowVal) / (HighVal – LowVal)))
Return “#” & Right(“0” & Hex(OutR),2) & Right(“0” & Hex(OutG),2) & Right(“0” & Hex(OutB),2)
TextBox Expression
=Code.SetHeatMapRange(Min(Fields!Count.Value,"DataSet")
, Max(Fields!Count.Value,"DataSet"))
Fill Colour in Matrix Cell
=Code.HeatMapColor(Fields!Count.Value)
Thanks.