how should I customize a function in Report Designer?

Stimulsoft Reports.JS discussion
Post Reply
huangliliu0917
Posts: 4
Joined: Wed Sep 06, 2017 6:16 am

how should I customize a function in Report Designer?

Post 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
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

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

Post 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
huangliliu0917
Posts: 4
Joined: Wed Sep 06, 2017 6:16 am

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

Post by huangliliu0917 »

Thanks very much
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

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

Post by Andrew »

Glad to help you!
Post Reply