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:
The correct effect:
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")
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.