User Variables

I want to add a variable using Variables.Add

Simple C# example:

double maxIndexValue = 103.0;
double minIndexValue = 98.0;
_ll.Variables.Add(“MaxIndexValue”, maxIndexValue);
_ll.Variables.Add(“MinIndexValue”, minIndexValue);

I want to uses these 2 vaiables to control the minimum and maximum value of the Value Axis (y) in a Simple Line Chart.

When I use the designer to use these variable, then they are not visible in the “Edit Maximum Value Automatic.Threshold” dialog etc.

But when inserting a simple text in the report container, then these variables are visible.

The only work-around that I found is adding 2 columns to the DataTable that is the datasource for the line graph values, and then adding the value to every record of the DataTable

date, value, minIdx, maxIdx
1/1/2016, 101, 98, 103
1/2/2016, 102, 98, 103
1/3/2016, 103, 98, 103
1/4/2016, 100, 98, 103
1/5/2016, 98, 98, 103
etc…

This works, but I don’t like it.
I would love to get some suggestions :slight_smile:

I’d try to set AddVarsToFields (which is a property of the component) to true. That might result in the variable-folder becoming available in the formula window. If all else fails, you might also try to just type in the variables even if intellisense does not offer them. That sometimes worked for me as well in other circumstances.

G.

Danke Günther,

This solved my issue 100%, and I got rid of all the unnecessary columns in my DataSet, it also speeded things up a little bit.

Thanks !!!
Joost