I think this what I am missing. Can you please provide an example of this?HighAley wrote: Mon Jun 17, 2019 11:40 am You could create the variable with your code and it will not be visible to the users.
Thanks
I think this what I am missing. Can you please provide an example of this?HighAley wrote: Mon Jun 17, 2019 11:40 am You could create the variable with your code and it will not be visible to the users.
Code: Select all
StiFunctions.AddFunctionCode: Select all
const string DIC_VAR_NAME = "custom_dictionary";
public string GetDictionaryValue(string key)
{
// get current report instance
var currentReportObject = ??? (don't know how to get the object, must be of type StiReport or probably it's descendant)
// get dictionary from report
if (!dictionaryObject.IsVariableExist(DIC_VAR_NAME)) return "";
var dictionaryObject = currentReportObject.Variables[DIC_VAR_NAME];
var dictionary = dictionaryObject as IDictionary<string, string>();
if (dictionary == null) return "";
return dictionary[key];
}