private void btnQry_Click(object sender, EventArgs e) { if (txtStorage.Text.Trim() == "") { this.ShowAlertMessage("请选择仓库!"); return; } if (txtMaterialGuid.Text == "") { this.ShowAlertMessage("请选择物料!"); return; } string strMaterialGuid = ""; if (txtMaterialGuid.Tag != null) { strMaterialGuid = txtMaterialGuid.Tag.ToString(); } StatReportManage StatReportManage = new StatReportManage(); gridControl1.DataSource = StatReportManage.StockDetailReport(strMaterialGuid, txtStorage.Tag.ToString()); //用于打印 DataTable dtl3 = base.GetDataTable((DataView)gridView1.DataSource); ds.Tables.Clear(); ds.Tables.Add(dtl3.Copy()); ds.Tables[0].TableName = "StockDetailReport"; }