Stimulsoft report variables
You can use variables in reports. Variable is a value that can be modified and reused. There are various types of values such as string, date, number, and array.
Variables need a unique name, a description, and a data type. Once a variable is declared for the report, it can be accessed from anywhere within the report.
A variable can be created within an event using the C# language, but that variable can only be used within that event.
Variables can be used as the data source of a label, and then use code within an event to set the value of the variable.
View and edit variables
Reports can prepare values for report-level variables that can be used to display fields.
Variables are stored in the data dictionary. To find the variables, do the following:
System variables
Each report has a list of built-in variables that can be used in the components on the report.
To view the system variables, go to .

Example: Convert data type using variables
This is an example of code for taking the string data type for the Load Category of a Load and changing it to a decimal.
Code within an event can use comments that start a line with : //
Example:
//
Set an interim variable.
decimal lnLoadCat1;
//
Get the value from the data- i.e. ProductionControlTrucks.LoadCategory1, and try
convert to a decimal.
// if
TryParse is successful - the value is in "lnLoadCat1"
// if
TryParse is not successful - the value is set to be 1.0 - a dummy
multiplier.
if
(!Decimal.TryParse( ProductionControlTrucks.LoadCategory1, out lnLoadCat1))
{
//The row could not be parsed as a decimal.
lnLoadCat1 = 1.0m; }
_LoadCat1 = lnLoadCat1;
At this point, the variable
_LoadCat1 can be used within the event. If it is
needed outside the event, you must create and use a report variable.