Passing a Hashtable to variable not working
Posted: Wed Sep 23, 2009 4:42 pm
I need to send a Hashtable to my report, so I created a new variable with a type of 'object'
In my app, I am passing the hashtable using this code:
On the report side, I'm casting the variable like this:
I don't get any errors, but count is always 0. When I step through the code on the app side, report.Dictionary.Variables["statusDictionary"].ValueObject shows null even after I set it with the 'testHash' object.
Any ideas? I'm using build 2009.2.411
In my app, I am passing the hashtable using this code:
Code: Select all
if (report.Dictionary.Variables["statusDictionary"] != null) {
report.Dictionary.Variables["statusDictionary"].Type = typeof(Hashtable);
Hashtable testHash = new Hashtable();
testHash.Add("0","Jen");
testHash.Add("1", "Roy");
report.Dictionary.Variables["statusDictionary"].ValueObject = testHash;
}
Code: Select all
Hashtable statuses = (Hashtable)this.statusDictionary;
this.Label5.Text = statuses.Count.ToString();
Any ideas? I'm using build 2009.2.411