Page 1 of 1

Variables

Posted: Sun Jun 11, 2006 4:44 am
by Michael K.
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

Posted: Mon Jun 12, 2006 4:00 am
by Edward
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();


Variables

Posted: Mon Jun 12, 2006 1:47 pm
by Michael K.

Thanks for help.