public void DG1_BIND(string strWhere) { if (strWhere == "") { strWhere = " where (1=0)"; } DataTable reportList = QueryItemAction.GetReportList(this.reportid, strWhere); if (reportList.Rows.Count != 0) { if (reportList.Columns.Contains("合同金额")) { if (!string.IsNullOrEmpty(reportList.Compute("sum(合同金额)", "").ToString())) { this.Lb_ContractAccount.Text = "合同金额总计:" + Convert.ToDouble(reportList.Compute("sum(合同金额)", "").ToString()); } else { this.Lb_ContractAccount.Text = "合同金额总计:0.000"; } } if (reportList.Columns.Contains("结算金额")) { if (!string.IsNullOrEmpty(reportList.Compute("sum(结算金额)", "").ToString())) { this.Lb_jiesuan.Text = "结算金额总计:" + Convert.ToDouble(reportList.Compute("sum(结算金额)", "").ToString()); } else { this.Lb_jiesuan.Text = "结算金额总计:0.000"; } } if (reportList.Columns.Contains("累计支付金额")) { if (!string.IsNullOrEmpty(reportList.Compute("sum(累计支付金额)", "").ToString())) { this.Lb_Leiji.Text = "累计支付金额总计:" + Convert.ToDouble(reportList.Compute("sum(累计支付金额)", "")); } else { this.Lb_Leiji.Text = "累计支付金额总计:0.000"; } } } else { this.Lb_ContractAccount.Text = "合同金额总计:0.000"; this.Lb_jiesuan.Text = "结算金额总计:0.000"; this.Lb_Leiji.Text = "累计支付金额总计:0.000"; } this.DG1.DataSource = reportList; this.DG1.DataBind(); }
private void dgdOrder_Bind(string strWhere) { if (strWhere == "") { strWhere = " where (1=0) "; } DataTable reportList = QueryItemAction.GetReportList(this.reportid, strWhere); this.dgdOrder.DataSource = QueryItemAction.GetReportList(this.reportid, strWhere); if (reportList.Rows.Count <= 0) { return; } this.dgdOrder.DataBind(); }
public void DG1_BIND(string strWhere) { DataTable reportList = QueryItemAction.GetReportList(this.reportid, strWhere); if (reportList.Columns.Contains("小计")) { if (reportList.Rows.Count != 0) { this.Label1.Text = "总计:" + Convert.ToDouble(reportList.Compute("sum(小计)", "").ToString()); } else { this.Label1.Text = "总计:0.00"; } } this.DG1.DataSource = reportList; this.DG1.DataBind(); }
protected void btnexecl_Click(object sender, EventArgs e) { string text = " where (1=1) "; if (this.Session["QUERY"] != null) { QueryItemCollection queryItemCollection = (QueryItemCollection)this.Session["QUERY"]; for (int i = 0; i < queryItemCollection.Count; i++) { if (queryItemCollection[i].ItemValue.Trim() != "") { text = text + " and " + queryItemCollection[i].StrSql.Replace("[]", queryItemCollection[i].ItemValue.Trim()).Trim(); } } } DataTable reportList = QueryItemAction.GetReportList(this.reportid, text); this.ExportToExecelAll(reportList, this.Lb_Title.Text + ".xls"); }