How can I transfer variables (not datasets) from my application to a report?
My workaround: define a label (or test box) and add this to the report data sources.
I there a better way to do this? Thanks for answer.
Variables
-
- Posts: 3
- Joined: Sun Jun 11, 2006 4:42 am
Variables
You can transfer variables from application to a report using the following code:
1.Create variable in Report Dictionary
2.Initialize variable before report running:
StiReport report = new StiReport();
report.Load("Variables.mrt");
report.Dictionary.Variables.Add(new StiVariable("Category", "MyVariable", typeof(int), "1", false));
report.Compile();
//Set Variable
report["myvariable"] = 123;
report.Render();
1.Create variable in Report Dictionary
2.Initialize variable before report running:
StiReport report = new StiReport();
report.Load("Variables.mrt");
report.Dictionary.Variables.Add(new StiVariable("Category", "MyVariable", typeof(int), "1", false));
report.Compile();
//Set Variable
report["myvariable"] = 123;
report.Render();
-
- Posts: 3
- Joined: Sun Jun 11, 2006 4:42 am
Variables
Thanks for help.