Report parameters option
Overview
Parameters are used to pass report data that is not directly related to its data source. They correspond to the concept of variables in the Stimulsoft world.
A parameter can for example be a string passed to a report that will be used as the title of the report.
The following C# types can be used :
- Value types (bool, int, double, ...)
- string
- Datetime
- Timestamp
They can be nullable.
Adding parameters in a report
Parameters can be added by creating a new Variable in the report.
See the official documentation.
How to use?
By Key/Value
var options = new ExecuteReportOptions("MyReport")
.WithParameter("MyVariableStringName", "MyValue")
.WithParameter("MyVariableIntegerName", 1);
await this.ExecuteReportWithOptionsAsync(options);
By Dictionary
var parameters = new Dictionary<string, object>()
{
{"MyVariableStringName", "MyValue"},
{"MyVariableIntegerName", 1}
};
var options = new ExecuteReportOptions("MyReport")
.WithParameters(parameters);
await this.ExecuteReportWithOptionsAsync(options);