The ejungrid table is famous for its high-simulation Excel-style formula calculation. For example, formula = sum (A1: B2) is used to calculate the sum of cell values from A1 to B2, in general, it is enough, but when we need to sum up the entire column of cells and the number of rows in the table is not fixed, it is a little troublesome. After studying excel, it is found that excel supports the sum (A: a) style area reference, which can solve this problem well. This function is also added to the Yijun table control.
Application 1: used in the statistical line
Procedure tform1.formcreate (Sender: tobject );
Begin
// Sets the total rows of table scripts.
Ejundatagrid1.footerrowcount: = 1;
// Design the statistical Formula
Ejundatagrid1.footercells [2, 0]. formula: = '= average (B: B )';
Ejundatagrid1.footercells [3, 0]. formula: = 'sum (C: C )';
End;
Application 2: used directly in cell formulas.