1
votes

I have the following Query to create a table :

 SELECT
   l.aliasnaam
  ,l.kultivar
  ,l.SkattingVirKult
  ,l.GelewerVirKult
  ,l.PersentKlaarKult
FROM
   LeweringVsSkatting as l
GROUP BY
   l.aliasnaam
  ,l.kultivar
  ,l.SkattingVirKult
  ,l.GelewerVirKult
  ,l.PersentKlaarKult

I want to add a gradient color in the column PersentKlaarKult with the following expression in the textbox background :

=Code.ColorDWB(sum(Fields!PersentKlaarKult.Value)
              ,Max(Fields!PersentKlaarKult.Value, “DataSet1”)
              ,Min(Fields!PersentKlaarKult.ValueFields!, “DataSet1”)
              ,“#2322EE”
              )

However I get the following error:

The BackgroundColor expression for the text box ‘PersentKlaarKult’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a dataset.

Any help would be much appreciated. Regards

2

2 Answers

0
votes

It looks like you are missing your dataset name in your sum function:

=Code.ColorDWB(sum(Fields!PersentKlaarKult.Value, “DataSet1”)
              ,Max(Fields!PersentKlaarKult.Value, “DataSet1”)
              ,Min(Fields!PersentKlaarKult.Value, “DataSet1”)
              ,“#2322EE”
              )
0
votes

Try this in your field Expression

=IIF(sum(Fields!PersentKlaarKult.Value, “DataSet1”) = “Blue”, “#2322EE”,
,IIF(Max(Fields!PersentKlaarKult.Value, “DataSet1”) = “Blue”, “#2322EE”,
,IIF(Min(Fields!PersentKlaarKult.Value, “DataSet1”) = “Blue”, “#2322EE”, “Blue”)))