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:
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.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.