回复 1楼langren82的帖子
可先进行数据绑定,之后在每页最后插入一行作为统计行。例如:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- DataTable dt = new DataTable();
- dt.Columns.Add("数量",typeof(int));
- for (int i = 0; i < 40; i++)
- {
- dt.Rows.Add(i);
- }
- this.FpSpread1.ActiveSheetView.DataSource = dt;
- this.FpSpread1.ActiveSheetView.PageSize = 20;
- this.FpSpread1.ActiveSheetView.AllowPage = true;
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- this.FpSpread1.ActiveSheetView.Rows.Add(20, 1);
- this.FpSpread1.ActiveSheetView.PageSize = 21;
- this.FpSpread1.ActiveSheetView.Cells[20,0].Formula="SUM(A1:A20)";
- }
复制代码 |