How to set primary variables? * SOLVED *
Posted: Tue Nov 30, 2010 3:20 am
Hi, How we can register primary data types like "string" in a report. We have .mrt report files that we load them while passing the date to them.
We have tried "RegData" method but after loading it treats the string variable like a "Char Array" and we tried the following code before loading the report with no success:
and this one:
We have tried "RegData" method but after loading it treats the string variable like a "Char Array" and we tried the following code before loading the report with no success:
Code: Select all
public void RegVar(string key, object value)
{
if(!this.report.IsCompiled)
{
this.report.Compile();
}
if (this.report.Dictionary.Variables.Contains(key))
{
this.report.Dictionary.Variables[key].ValueObject = value;
this.report.Dictionary.Variables[key].Value = value.ToString();
}
else
{
this.report.Dictionary.Variables.Add(new StiVariable(key, value));
}
}
Code: Select all
public void RegVar(string key, object value)
{
this.report[key] = value;
}