private void btnPicture_Click(object sender, EventArgs e) { try { if (dgvReport.DataSource != null) { DataTable pictureDt = ((DataTable)(this.dgvReport.DataSource)).Copy(); pictureDt.Rows.RemoveAt(pictureDt.Rows.Count - 1); TableColumn[] columns = new TableColumn[1]; columns[0].ColumnName = "总金额"; columns[0].ColumnField = "合计"; FrmShowGraphic showGraphic = new FrmShowGraphic(pictureDt, "名称", columns, DataTableStruct.Rows, "门诊收入图示"); showGraphic.ShowDialog(); } } catch (Exception error) { MessageBox.Show(error.Message); } }
private void btnPicInstore_Click(object sender, EventArgs e) { try { if (this.dgrdInMaster.DataSource != null) { DataTable pictureDt = ((DataTable)(this.dgrdInMaster.DataSource)).Copy(); pictureDt.Rows.RemoveAt(pictureDt.Rows.Count - 1); TableColumn[] columns = new TableColumn[1]; columns[0].ColumnName = "入库金额"; columns[0].ColumnField = "RETAILFEE"; FrmShowGraphic showGraphic = new FrmShowGraphic(pictureDt, "PRJNAME", columns, DataTableStruct.Rows, "药品入库图示"); showGraphic.ShowDialog(); } } catch (Exception error) { MessageBox.Show(error.Message); } }