Hello.
Where I can find a list of supported data types in reports.
Currently I am trying to create a custom function with a dictionary argument (.net core, dictionary<string, string>) but in designer it appears with parameter type object instead of dictionary<string, string>.
Could you please provide me a simple example how I can operate with dictionary data type in reports?
Dictionary parameter of custom function
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Dictionary parameter of custom function
Hello,
Please try to register it as business objects:
report.RegBusinessObject(object);
report.Dictionary.SynchronizeBusinessObjects();
Thank you.
Please try to register it as business objects:
report.RegBusinessObject(object);
report.Dictionary.SynchronizeBusinessObjects();
Thank you.
Re: Dictionary parameter of custom function
I see from reflection information that the "object" has an underlying type of StiBusinessObject. So what I've done is declare an input parameter of the same type and then a simple cast of parameter's BusinessObjectValue property:
Was (dictionary displayed as "object" in designer):
Changed to:
Thanks.
Was (dictionary displayed as "object" in designer):
Code: Select all
public static string GetDictionaryValue(IDictionary<string, string> fields, string key)
{
???
}
Code: Select all
public static string GetDictionaryValue(StiReportNS.Dictionary.StiBusinessObject fields, string key)
{
var dictionary = fields.BusinessObjectValue as IDictionary<string, string>;
...
var value = dictionary[key];
...
}
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Dictionary parameter of custom function
Hello
Please let us know if you need any additional help.
Thank you.
Please let us know if you need any additional help.
Thank you.