Page 1 of 1

how should I customize a function in Report Designer?

Posted: Fri Nov 10, 2017 5:34 am
by huangliliu0917
I am now using Stimulsoft.Report.JS 2017.1.11, how should I customize a function in Report Designer? I want to implement a function that converts a date to uppercase

Re: how should I customize a function in Report Designer?

Posted: Tue Nov 14, 2017 1:08 am
by Edward
Hi Huangliliu,

Yes, that is possible. Please check the following sample that could be used as a starting point to implement the function you needed:

Code: Select all

public static addFunction(
    category: string, 
    groupFunctionName: string, 
    functionName: string, 
    description: string, 
    typeOfFunction: string, 
    returnType: Type, 
    returnDescription: string = String.empty, 
    argumentTypes: Type[] = null, 
    argumentNames: string[] = null, 
    argumentDescriptions: string[] = null, 
    jsFunction: Function = null
): StiFunction {}

Code: Select all

var function1 = function (checklist, state) {
                var result = "";
                 
                return result;
            }
 
            function2 = function (sender, value) {
                 
                return value;
            }
 
            Stimulsoft.Report.Dictionary.StiFunctions.addFunction("checklistFunction", "checklistFunction", "checklistFunction", "", "", String, "", [String, String], [""], [""], function1);
            Stimulsoft.Report.Dictionary.StiFunctions.addFunction("checklistFunction", "checklistFunction", "checklistFunctionDrill", "", "", String, "", [Stimulsoft.Report.Components.StiText, String], [""], [""], function2);

Thank you,
Edward

Re: how should I customize a function in Report Designer?

Posted: Tue Nov 21, 2017 6:32 am
by huangliliu0917
Thanks very much

Re: how should I customize a function in Report Designer?

Posted: Tue Nov 21, 2017 8:10 am
by Andrew
Glad to help you!