Clarification about ReportVariable.Value and ReportVariable.ValueObject
Posted: Sun Nov 30, 2008 6:51 pm
In 2008.2.247.0 version (of 3 June 2008) i used to set the "ValueObject" property for all reportvariables types. Example, if the reportvariable was a string i set MyReportVariable.ValueObject="MyString" and it worked.
Now in 2008.3.311.0 (of 19 November 2008) if i do the same thing the reportvariable result is "", i must use the "value" property instead of "valueobject".
This is an example:
I know that this may have sense (the "valueobject" property must be used for object types such as image or datetime, while "value" property must be used for primitives such as Integer, Long), but at now i'm a little confused (in previous version assigning a string to valueobject worked).
Could you please explain what is the correct way to set a report variable value in 2008.3 version? In which case must i use "value" property and in which case must i use "valueobject" property?
And why, in the string example above, when i set the "value" property, the "valueobject" property is automatically assigned too?
-- added
I've noticed now that "value" property is string, so i assume that "value" must be used to assign string values, while "valueobject" for all the other types. Actually valueobject doesn't work for certain types such as "Integer", so the only way to assign a value seems to use the "value" property transforming the value in string.
Thank you.
Now in 2008.3.311.0 (of 19 November 2008) if i do the same thing the reportvariable result is "", i must use the "value" property instead of "valueobject".
This is an example:
Code: Select all
Dim v As New Stimulsoft.Report.Dictionary.StiVariable("MyStringReportVariable", System.Type.GetType("System.String"))
v.ValueObject = "MyStringValueObject"
System.Windows.Forms.MessageBox.Show(String.Concat("The value is empty for both properties: ValueObject=", v.ValueObject, " Value=", v.Value))
v.Value = "MyStringValue"
System.Windows.Forms.MessageBox.Show(String.Concat("The value is correct for both properties: ValueObject=", v.ValueObject, " Value=", v.Value))
Could you please explain what is the correct way to set a report variable value in 2008.3 version? In which case must i use "value" property and in which case must i use "valueobject" property?
And why, in the string example above, when i set the "value" property, the "valueobject" property is automatically assigned too?
-- added
I've noticed now that "value" property is string, so i assume that "value" must be used to assign string values, while "valueobject" for all the other types. Actually valueobject doesn't work for certain types such as "Integer", so the only way to assign a value seems to use the "value" property transforming the value in string.
Thank you.