The main content of this example is
1. Set the sum () formula and calculate it.
2. Set table borders
3. Merge cells and align them.
Document. form1.cellweb1. protectformula = false;
Document. form1.cellweb1. calcmanaually = true;
VaR currcol = colnum + 3;
For (VAR I = 3; I <currcol; I ++)
{
// Set the calculation range of sum (A1: A9) Formula
VaR scell = Document. form1.cellweb1. celltolabel (I, 7 );
VaR ecell = Document. form1.cellweb1. celltolabel (I, 6 + rownum );
VaR STR = "sum (" + scell + ":" + ecell + ")";
VaR AAA = Document. form1.cellweb1. setformula (I, 6, 0, STR );
}
// Formula Calculation
Document. form1.cellweb1. calculateall ();
// Set table borders
Document. form1.cellweb1. drawgridline (, 2 + colnum, 6 + rownum,-1 );
// Merge Cells
Document. form1.cellweb1. mergecells (5, currrow, 6, currrow );
// Assign values to cells
Document. form1.cellweb1. setcellstring (5, currrow, 0, "Reporter ");
// Set alignment
Document. form1.cellweb1. setcellalign (5, currrow, 0, 32 + 2 );
Document. form1.cellweb1. mergecells (7, currrow, 8, currrow );
Document. form1.cellweb1. setcellstring (7, currrow, 0, useruprpt );
Document. form1.cellweb1. setcellalign (7, currrow, 0, 32 + 1 );