private void btnQry_Click(object sender, EventArgs e) { gridView1.Columns.Clear(); if (dtpBeginDate.Text.Trim() == "") { this.ShowAlertMessage("请选择开始日期!"); return; } if (dtpEndDate.Text.Trim() == "") { this.ShowAlertMessage("请选择截止日期!"); return; } StatReportManage StatReportManage = new StatReportManage(); DataTable dtl = StatReportManage.sp_Payment_Report(dtpBeginDate.Text, dtpEndDate.Text); this.gridControl1.DataSource = dtl; for (int i = 1; i < gridView1.Columns.Count; i++) { gridView1.Columns[i].DisplayFormat.FormatType = FormatType.Numeric; gridView1.Columns[i].DisplayFormat.FormatString = "0.####"; } gridView1.Columns["合计"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum; gridView1.Columns["合计"].SummaryItem.FieldName = "合计"; gridView1.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, "合计", gridView1.Columns["合计"], "小计:{0:N2}"); //可以显示小计 gridView1.OptionsView.ShowFooter = true; //用于打印 //DataTable dtl3 = base.GetDataTable((DataView)gridView1.DataSource); //ds.Tables.Clear(); //ds.Tables.Add(dtl3.Copy()); //ds.Tables[0].TableName = "PaymentOrderReport"; }