Good Day,
Please could I get some guidance on how to embed custom functions within a report used in the designer (winforms), I have looked online and all videos seem to reference very old versions of this particular designer.
Registering function in Report Designer 2020.3.2
-
- Posts: 6247
- Joined: Tue Mar 20, 2018 5:34 am
Re: Registering function in Report Designer 2020.3.2
Hello,
Please check the following code:
Thank you.
Please check the following code:
Code: Select all
public class MyFunction
{
private const string Category = "MyFuncCategory";
public static string MyFunc(string value)
{
return value.ToUpper();
}
public static void RegisterFunctions()
{
var ParamNames = new string[1];
var ParamTypes = new Type[1];
var ParamDescriptions = new string[1];
ParamNames[0] = "value";
ParamDescriptions[0] = "Descriptions";
ParamTypes[0] = typeof(string);
Stimulsoft.Report.Dictionary.StiFunctions.AddFunction(Category, "MyFunc", "MyFunc", "Description", typeof(MyFunction),
typeof(string), "Return Description", ParamTypes, ParamNames, ParamDescriptions);
}
}
Re: Registering function in Report Designer 2020.3.2
Thanks, the code was not the issue, the designer was, the UI is not intuitive at all and the functionality to add code is hidden in layers upon layers of settings. In any event, I eventually found it.
-
- Posts: 6247
- Joined: Tue Mar 20, 2018 5:34 am
Re: Registering function in Report Designer 2020.3.2
Hello,
Ok.
Thank you.
Ok.
Thank you.