Variables

Stimulsoft Reports.NET discussion
Post Reply
Michael K.
Posts: 3
Joined: Sun Jun 11, 2006 4:42 am

Variables

Post 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.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Variables

Post 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();

Michael K.
Posts: 3
Joined: Sun Jun 11, 2006 4:42 am

Variables

Post by Michael K. »


Thanks for help.
Post Reply