Function drag-fill (Excel alike)

  • Last update:  2021-04-12
  • I. Description

    Everyone knows that Excel is very powerful, but some Excel functions in FineReport cannot be realized; for example, a calculation formula: E3*F1, I want to realize the calculation of E3 column cell increment and F1 cell unchanged, use it in Excel Absolute cell reference (=E3*$F$1) is easy to implement, but it is impossible to directly drop and drag FineReport. If you drag and drop directly, the cell will increase with the increase, as shown in the figure:

    1.gif

    The correct effect:

    2.gif

    II. Idea

    This problem is essentially a problem of automatic formula expansion. In fact, FR only supports Excel's commonly used formulas, and there are many Excel formulas that are not fully supported. Since here =E3*F1 is dragged, it will automatically increase the rank number. So let F1 be the result of a calculation instead of a cell.

    III. Solution

    The eval formula can only return the calculation result instead of the cell; we can enter the formula in the G3 cell: = E3 *eval("F" + "1")

    3.png

    Before the formula is executed, the + operator is not executed, so there is no F1 cell in the formula, so just drag the formula vertically.

    Note: Since F1 in the calculation formula here is the calculation result of eval, suppose it is filled here. For example, the value of F1 cell is a text box. After the value is modified, the calculation result of G3/G4/G5/G6 will not change dynamically.

    IV. Preview effect

    After saving, click pagination preview to see the effect described above.

    Attachment List


    Theme: Report Features
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy