Using Report Variables in Code
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.Report variables let a report receive values from the application — user input, settings, calculated data.
Passing values to variables. After loading and compiling the report, assign values through the report indexer using the variable names defined in the template:
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:

Passing values to variables. After loading and compiling the report, assign values through the report indexer using the variable names defined in the template:
var report = new StiReport();
report.Load(@"..\Variables.mrt");
report.Compile();
report["Name"] = textBoxName.Text;
report["Surname"] = textBoxSurname.Text;
report["Email"] = textBoxEmail.Text;
report.Show();The indexer (report["Name"]) reads and writes report variables by name. Because values are assigned after Compile() and before rendering, the report is generated with exactly the data your application supplies.На скриншоте ниже Вы можете увидеть результат выполнения данного кода:
