• The problem is that the aggregate is bound to the dataset "uspGetReportSettings". Everything inside that aggregate (between the two parenthesis) is calculated with that scope and the field "Response" doesn't exists in that dataset.

    I would try another approach based on this article http://blogs.msdn.com/b/bwelcker/archive/2007/07/11/laser-guided-missiles-report-localization-through-parameters.aspx.

    1. Unpivot your dataset "uspGetReportSettings" so there is one row for each setting instead of one column:

    Setting Value

    gradient_colour1 Red

    gradient_colour2 Blue

    ... ...

    2. Create a hidden multivalued parameter based on that dataset with setting as label and Value as value. Set the default values to the same dataset and the Value field to 'Value'.

    3. Copy and paste this code to custom code:

    Public Function GetReportSetting(P as Parameter, Label as String) as String

    Dim i As Integer

    For i = 0 to Ubound(P.Value)

    If (P.Label(i) = Label) Then Return P.Value(i)

    Next i

    Return Label

    End Function

    4. Use the code below to change the background color:

    Code.GetReportSetting(Parameters!uspGetReportSettings, "gradient_colour" & Fields!Response.Value)

    Check out the attached file for an example!