Successfully!

Error!

Function Manager

  • Last update:  2020-12-02
  • I. Overview

    1) FineReport features strong extensibility. If your system requires specific calculation formulas due to the complex business logic, you may define your own function class through FineReport’s secondary development interface.

    2) The role of the function manager is to load a user-defined function class into the designer, so that custom functions can be used as if they were formulas.

    II. Steps

    1. Customize a function

    1) Function definition rule: Functionname(Para,Para,...), where Functionname is the function name and Para means a parameter.

    2) The class must inherit com.fr.script.AbstractFunction.

    3) After it is compiled successfully, place the file xxx.class in the directory %FR_HOME%\webapps\webroot\WEB-INF\classes\com\fr\function.

     

    4) Place the file xxx.java in the same directory and view the code in FineReport.

    5) For examples of custom functions, please refer to https://git.fanruan.com/demo/example/src/release/10.0/src/main/java/com/fr/function/StringCat.java.


    2. Click [Server]>[Function Manager], a setting pane will pop up.

     


    3. Add a function – method 1

    1) Click the +button to add a function, whose name is Function2 by default.

    2) Click the Select button to display files in the current working directory.

    3) Expand com\fr\function and select the custom .class file to be placed into the function.

     


    4. Add a function – method 2

    1) Right-click on the empty space of the function list in the left-hand pane, click [Add] to add a function whose name is Function3 by default.

    2) Click the Select button to display files in the current working directory.

    3) Expand com\fr\function and select the custom .class file to be placed into the function.

    1.gif


    5. Rename a function

    1) Double-click a function name to modify it.

     


    6. View a function

    1) Select the function to be viewed.

    2) Click the Edit button to display the complete code of the function.

    3) If the file xxx.java is not placed in the working directory, then the complete code cannot be viewed.

     


    7. Add description to a function

    1) Select the function to which description will be added.

    2) Input descriptive text in the description box.

     


    8. Copy a function – method 1

    1) Select the function to be copied.

    2) Click the   button to add a function with the same class file and description, whose name is CopyOf+name of the original function.

     


    9. Copy a function – method 2

    1) Select the function to be copied.

    2) Right-click on the empty space of the function list in the left-hand pane, click Copy to add a function with the same class file and description, whose name is CopyOf+name of the original function.

    2.gif


    10. Set function order – method 1

    1) Select the function to be sorted.

    2) Click the a.png button to move the function up and click the b.png button to move it down.

     


    11. Set function order – method 2

    1) Select the function to be sorted.

    2) Right-click on the empty space of the function list in the left-hand pane, click Move Up to move the function up and click Move Down to move it down.

     


    12. Auto sorting – method 1

    1) Click the   button to sort functions automatically in alphabetical order.

     


    13. Auto sorting – method 2

    1) Right-click on the empty space of the function list in the left-hand pane, click Sort to sort functions automatically in alphabetical order.

     


    14. Remove a function – method 1

    1) Select the function to be removed.

    2) Click the C.png button and click OK in the pop-up confirmation box.

     


    15. Remove a function – method 2

    1) Select the function to be removed.

    2) Right-click on the empty space of the function list in the left-hand pane, click Remove and click OK in the pop-up confirmation box.

     


    Attachment List


    Theme: Designer and Upgrade
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback