Hi,
Can you give code how to find the number and names of the variable can be fetched from .mrt file.
My requirement is I want to create report dynamically and when I do so immediately I want to generate user interface to pass parameters to the report from aspx page.
Thanks
Abdul Aleem
regarding accessing the number and names of the variables in .mrt files
-
- Posts: 37
- Joined: Tue Sep 15, 2009 9:42 am
- Location: jeddah
regarding accessing the number and names of the variables in .mrt files
Hi Abdul,
You can add variables and categories in the following way:
And there is a method to count all variables in the Dictionary:
assigning of the variable is very simple too:
Thank you.
You can add variables and categories in the following way:
Code: Select all
report.Dictionary.Variables.Add("MyCategory1");
if (report.Dictionary.Variables["MyVariable"] == null)
report.Dictionary.Variables.Add(new StiVariable("Category2", "MyVariable", typeof(int), "1", false));
And there is a method to count all variables in the Dictionary:
Code: Select all
int variables=0;
foreach (StiVariable variable in report.Dictionary.Variables)
{
if (!variable.IsCategory) variables++;
}
Code: Select all
report["MyVariable"] = 5;