| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Core.Mes.Client.Common;
- using Infragistics.Win.UltraWinGrid;
- using Infragistics.Win.UltraWinGrid.ExcelExport;
- using Infragistics.Win;
- using System.Collections;
- using CoreFS.CA06;
- using System.Diagnostics;
- using System.IO;
- using Core.LgMes.Client.Report;
- namespace Core.LgMes.Client.lgIntegrationQuery
- {
- public partial class FrmMaterialInoutCCM : frmStyleBase
- {
- private bool bAddNow, bEditNow, bDelNow;
- private UltraGridRow currRow = null;
- public FrmMaterialInoutCCM()
- {
- InitializeComponent();
- }
- private void FrmMaterialInout_Load(object sender, EventArgs e)
- {
- ultraDateTimeEditor1.DateTime = DateTime.Today;
- ultraDateTimeEditor2.DateTime = DateTime.Today;
- ValueList vl = new ValueList();
- vl.ValueListItems.Add("6#机", "6#机");
- vl.ValueListItems.Add("5#机", "5#机");
- vl.ValueListItems.Add("7#机", "7#机");
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["STATIONCODE"].ValueList = vl;
- proc_SetToolbarButtons();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- {
- if (bAddNow || bEditNow || bDelNow)
- return;
- proc_Query();
- proc_SetToolbarButtons();
- break;
- }
- case "Add":
- {
- if (bAddNow || bEditNow || bDelNow)
- return;
- currRow = this.ultraGrid1.DisplayLayout.Bands[0].AddNew();
- this.proc_setCellReadOnly(currRow, false);
- bAddNow = true;
- this.proc_SetToolbarButtons();
- break;
- }
- case "Edit":
- {
- if (ultraGrid1.ActiveRow == null || (bAddNow || bEditNow || bDelNow))
- return;
- currRow = ultraGrid1.ActiveRow;
- this.proc_setCellReadOnly(currRow, false);
- bEditNow = true;
- this.proc_SetToolbarButtons();
- break;
- }
- case "Save":
- {
- if (bAddNow)
- {
- proc_Add("Add");
- }
- else if (bEditNow)
- {
- proc_Add("Edit");
- }
- proc_Query();
- break;
- }
- case "Delete":
- {
- if (ultraGrid1.ActiveRow == null || (bAddNow || bEditNow || bDelNow))
- return;
- bDelNow = true;
- this.proc_SetToolbarButtons();
- proc_Delete();
- bDelNow = false;
- proc_Query();
- this.proc_SetToolbarButtons();
- break;
- }
- case "Export":
- {
- try
- {
- if (ultraGrid1.Rows.Count == 0) return;
- string strFileName = "连二作业区物料申报记录" + DateTime.Now.ToString("yyyyMMdd");
- SaveFileDialog dlg = new SaveFileDialog();
- dlg.Title = "保存";
- dlg.OverwritePrompt = true;
- dlg.Filter = "Excel文件(*.xls)|*.xls";
- dlg.AddExtension = true;
- dlg.FileName = strFileName;
- if (dlg.ShowDialog() == DialogResult.OK)
- {
- strFileName = dlg.FileName;
- ultraGridExcelExporter1.Export(ultraGrid1, strFileName);
- if (MessageBox.Show("数据导出成功!\r\n需要打开所导出文件吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
- {
- ultraGridExcelExporter1.Export(ultraGrid1, strFileName);
- ProcessStartInfo p = new ProcessStartInfo(strFileName);
- p.WorkingDirectory = Path.GetDirectoryName(strFileName);
- Process.Start(p);
- }
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- break;
- }
- case "Cancel":
- {
- if (!(bAddNow || bEditNow)) return;
- string strOpt = " [" + (bAddNow ? "新增" : (bEditNow ? "修改" : "")) + "]";
- if (MessageBox.Show("确定要取消" + strOpt + "操作吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
- return;
- if (bAddNow)
- {
- currRow.Delete(false);
- currRow = null;
- if (ultraGrid1.Rows.Count > 0)
- {
- ultraGrid1.ActiveCell = ultraGrid1.Rows[ultraGrid1.Rows.Count - 1].Cells["STATIONCODE"];
- ultraGrid1.Rows[ultraGrid1.Rows.Count - 1].Cells["STATIONCODE"].Selected = false;
- }
- bAddNow = false;
- }
- else if (bEditNow)
- {
- this.proc_setCellReadOnly(currRow, true);
- currRow = null;
- bEditNow = false;
- }
- this.proc_SetToolbarButtons();
- break;
- }
- case "Close":
- {
- this.Close();
- break;
- }
- }
- }
- public void proc_Query()
- {
- Cursor oldCursor = this.Cursor;
- this.Cursor = Cursors.WaitCursor;
- try
- {
- this.dataTable1.Clear();
- string sqlStr = @"SELECT * FROM DEV_MATERIAL_LZREPORT WHERE
- OPTDATE BETWEEN TO_DATE('{0}','YYYY-MM-DD HH24:MI:SS') AND TO_DATE('{1}','YYYY-MM-DD HH24:MI:SS')";
- if (ultraDateTimeEditor2.DateTime.Date.Subtract(ultraDateTimeEditor1.DateTime.Date).Days > 90)
- {
- MessageBox.Show("查询时间不可超过3个月。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
- return;
- }
- if (ultraDateTimeEditor1.DateTime.Date > ultraDateTimeEditor2.DateTime.Date)
- {
- MessageBox.Show("查询开始日期不能大于结束日期!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
- return;
- }
- string strFrom = ultraDateTimeEditor1.DateTime.ToString("yyyy-MM-dd") + " 00:00:00";
- string strTo = ultraDateTimeEditor2.DateTime.ToString("yyyy-MM-dd") + " 23:59:59";
- sqlStr = string.Format(sqlStr, strFrom, strTo);
- //调用服务端方法
- CoreClientParam CCP_LgEts = new CoreClientParam();
- DataTable dt = new DataTable();
- CCP_LgEts.ServerName = "Core.LgMes.Server.Common.ComDBExecute";
- CCP_LgEts.MethodName = "doSimpleQuery";
- CCP_LgEts.ServerParams = new object[] { sqlStr };
- CCP_LgEts.SourceDataTable = dt;
- this.ExecuteQueryToDataTable(CCP_LgEts, CoreInvokeType.Internal);
- DataSet ds = new DataSet();
- if (dt != null && dt.Rows.Count > 0)
- {
- this.dataTable1.Rows.Clear();
- DataRow dr;
- for (int iRow = 0; iRow < dt.Rows.Count; iRow++)
- {
- dr = this.dataTable1.NewRow();
- for (int jCol = 0; jCol < dt.Columns.Count; jCol++)
- {
- if (this.dataTable1.Columns.Contains(dt.Columns[jCol].ColumnName))
- {
- dr[dt.Columns[jCol].ColumnName] = dt.Rows[iRow][jCol];
- }
- }
- this.dataTable1.Rows.Add(dr);
- }
- }
- ultraGrid1.UpdateData();
- if (ultraGrid1.Rows.Count > 0)
- {
- ultraGrid1.ActiveCell = ultraGrid1.Rows[0].Cells["STATIONCODE"];
- ultraGrid1.Rows[0].Cells["STATIONCODE"].Selected = false;
- }
- this.proc_SetUltraGridReadOnly(ultraGrid1);
- ArrayList alistColumns = new ArrayList();
- for (int i = 0; i < this.dataTable1.Columns.Count; i++)
- {
- if (this.dataTable1.Columns[i].ColumnName != "OPTDATE" && this.dataTable1.Columns[i].ColumnName != "OPTMAN" &&
- this.dataTable1.Columns[i].ColumnName != "UUID_" && this.dataTable1.Columns[i].ColumnName != "STATIONCODE")
- alistColumns.Add(this.dataTable1.Columns[i].ColumnName);
- }
- proc_Statics(ref ultraGrid1, alistColumns, true, " {0:############0.0}");
- }
- catch
- { }
- finally
- {
- this.Cursor = oldCursor;
- }
-
- }
- public void proc_Add(string flag)
- {
- try
- {
- this.ultraGrid1.UpdateData();
- if (dataTable1.Rows.Count > 0)
- {
- string strErr = "";
- string strMess = "";
- if (flag == "Add")
- {
- ArrayList arry = new ArrayList();
- arry.Add("frmLzMaterial.Insert");
- string str1 = ultraGrid1.ActiveRow.Cells["STATIONCODE"].Text;
- string str2 = ultraGrid1.ActiveRow.Cells["SXFGJ"].Text;
- string str3 = ultraGrid1.ActiveRow.Cells["QCBFGJ"].Text;
- string str4 = ultraGrid1.ActiveRow.Cells["GGFGJ"].Text;
- string str5 = ultraGrid1.ActiveRow.Cells["GGTYJ"].Text;
- string str6 = ultraGrid1.ActiveRow.Cells["DTGBHZ"].Text;
- string str7 = ultraGrid1.ActiveRow.Cells["CDTGBHZ"].Text;
- string str8 = ultraGrid1.ActiveRow.Cells["GGBHZ"].Text;
- string str9 = ultraGrid1.ActiveRow.Cells["ZTGBHZ_ZT"].Text;
- string str10 = ultraGrid1.ActiveRow.Cells["ZTGBHZ_TI"].Text;
- string str11 = ultraGrid1.ActiveRow.Cells["ZTGBHZ_A"].Text;
- string str12 = ultraGrid1.ActiveRow.Cells["GTGBHZ"].Text;
- string str13 = ultraGrid1.ActiveRow.Cells["TCGBHZ"].Text;
- string str14 = ultraGrid1.ActiveRow.Cells["ZTGBHZ_7"].Text;
- string str15 = ultraGrid1.ActiveRow.Cells["GTGBHZ_7GT"].Text;
- string str16 = ultraGrid1.ActiveRow.Cells["GTGBHZ_7FCS"].Text;
- string str17 = ultraGrid1.ActiveRow.Cells["ZYBHZ_7"].Text;
- string str18 = ultraGrid1.ActiveRow.Cells["BHTG"].Text;
- string str19 = ultraGrid1.ActiveRow.Cells["BHTGMFD"].Text;
- string str20 = ultraGrid1.ActiveRow.Cells["KHSKHKT"].Text;
- string str21 = ultraGrid1.ActiveRow.Cells["XWMB"].Text;
- string str22 = ultraGrid1.ActiveRow.Cells["KHSK_56"].Text;
- string str23 = ultraGrid1.ActiveRow.Cells["CDTKHSK_56"].Text;
- string str24 = ultraGrid1.ActiveRow.Cells["MHKKHSK"].Text;
- string str25 = ultraGrid1.ActiveRow.Cells["MB_56"].Text;
- string str26 = ultraGrid1.ActiveRow.Cells["KHSK_7"].Text;
- string str27 = ultraGrid1.ActiveRow.Cells["MB_7"].Text;
- string str28 = ultraGrid1.ActiveRow.Cells["GPHGGBHZ"].Text;
- string str29 = ultraGrid1.ActiveRow.Cells["SB"].Text;
- string str30 = ultraGrid1.ActiveRow.Cells["ZBZZ"].Text;
- string str31 = ultraGrid1.ActiveRow.Cells["ZBSK"].Text;
- string str32 = ultraGrid1.ActiveRow.Cells["ZBZZ1"].Text;
- string str33 = ultraGrid1.ActiveRow.Cells["PTZBSK"].Text;
- string str34 = ultraGrid1.ActiveRow.Cells["CDTZBSK"].Text;
- string str35 = ultraGrid1.ActiveRow.Cells["PTSB"].Text;
- string str36 = ultraGrid1.ActiveRow.Cells["CDTSB"].Text;
- string str37 = ultraGrid1.ActiveRow.Cells["MFD"].Text;
- string str38 = ultraGrid1.ActiveRow.Cells["GLQ"].Text;
- string str39 = this.UserInfo.GetUserName();
- arry.Add(str1);
- arry.Add(str2);
- arry.Add(str3);
- arry.Add(str4);
- arry.Add(str5);
- arry.Add(str6);
- arry.Add(str7);
- arry.Add(str8);
- arry.Add(str9);
- arry.Add(str10);
- arry.Add(str11);
- arry.Add(str12);
- arry.Add(str13);
- arry.Add(str14);
- arry.Add(str15);
- arry.Add(str16);
- arry.Add(str17);
- arry.Add(str18);
- arry.Add(str19);
- arry.Add(str20);
- arry.Add(str21);
- arry.Add(str22);
- arry.Add(str23);
- arry.Add(str24);
- arry.Add(str25);
- arry.Add(str26);
- arry.Add(str27);
- arry.Add(str28);
- arry.Add(str29);
- arry.Add(str30);
- arry.Add(str31);
- arry.Add(str32);
- arry.Add(str33);
- arry.Add(str34);
- arry.Add(str35);
- arry.Add(str36);
- arry.Add(str37);
- arry.Add(str38);
- arry.Add(str39);
- CommonClientToServer cctos = new CommonClientToServer();
- cctos.ob = this.ob;
- cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBSave",
- "doSimpleSave", arry, out strErr);
- this.proc_setCellReadOnly(currRow, true);
- currRow = null;
- bAddNow = false;
- }
- else if (flag == "Edit")
- {
- ArrayList arry = new ArrayList();
- arry.Add("frmLzMaterial.Update");
- string str1 = ultraGrid1.ActiveRow.Cells["STATIONCODE"].Text;
- string str2 = ultraGrid1.ActiveRow.Cells["SXFGJ"].Text;
- string str3 = ultraGrid1.ActiveRow.Cells["QCBFGJ"].Text;
- string str4 = ultraGrid1.ActiveRow.Cells["GGFGJ"].Text;
- string str5 = ultraGrid1.ActiveRow.Cells["GGTYJ"].Text;
- string str6 = ultraGrid1.ActiveRow.Cells["DTGBHZ"].Text;
- string str7 = ultraGrid1.ActiveRow.Cells["CDTGBHZ"].Text;
- string str8 = ultraGrid1.ActiveRow.Cells["GGBHZ"].Text;
- string str9 = ultraGrid1.ActiveRow.Cells["ZTGBHZ_ZT"].Text;
- string str10 = ultraGrid1.ActiveRow.Cells["ZTGBHZ_TI"].Text;
- string str11 = ultraGrid1.ActiveRow.Cells["ZTGBHZ_A"].Text;
- string str12 = ultraGrid1.ActiveRow.Cells["GTGBHZ"].Text;
- string str13 = ultraGrid1.ActiveRow.Cells["TCGBHZ"].Text;
- string str14 = ultraGrid1.ActiveRow.Cells["ZTGBHZ_7"].Text;
- string str15 = ultraGrid1.ActiveRow.Cells["GTGBHZ_7GT"].Text;
- string str16 = ultraGrid1.ActiveRow.Cells["GTGBHZ_7FCS"].Text;
- string str17 = ultraGrid1.ActiveRow.Cells["ZYBHZ_7"].Text;
- string str18 = ultraGrid1.ActiveRow.Cells["BHTG"].Text;
- string str19 = ultraGrid1.ActiveRow.Cells["BHTGMFD"].Text;
- string str20 = ultraGrid1.ActiveRow.Cells["KHSKHKT"].Text;
- string str21 = ultraGrid1.ActiveRow.Cells["XWMB"].Text;
- string str22 = ultraGrid1.ActiveRow.Cells["KHSK_56"].Text;
- string str23 = ultraGrid1.ActiveRow.Cells["CDTKHSK_56"].Text;
- string str24 = ultraGrid1.ActiveRow.Cells["MHKKHSK"].Text;
- string str25 = ultraGrid1.ActiveRow.Cells["MB_56"].Text;
- string str26 = ultraGrid1.ActiveRow.Cells["KHSK_7"].Text;
- string str27 = ultraGrid1.ActiveRow.Cells["MB_7"].Text;
- string str28 = ultraGrid1.ActiveRow.Cells["GPHGGBHZ"].Text;
- string str29 = ultraGrid1.ActiveRow.Cells["SB"].Text;
- string str30 = ultraGrid1.ActiveRow.Cells["ZBZZ"].Text;
- string str31 = ultraGrid1.ActiveRow.Cells["ZBSK"].Text;
- string str32 = ultraGrid1.ActiveRow.Cells["ZBZZ1"].Text;
- string str33 = ultraGrid1.ActiveRow.Cells["PTZBSK"].Text;
- string str34 = ultraGrid1.ActiveRow.Cells["CDTZBSK"].Text;
- string str35 = ultraGrid1.ActiveRow.Cells["PTSB"].Text;
- string str36 = ultraGrid1.ActiveRow.Cells["CDTSB"].Text;
- string str37 = ultraGrid1.ActiveRow.Cells["MFD"].Text;
- string str38 = ultraGrid1.ActiveRow.Cells["GLQ"].Text;
- string str39 = this.UserInfo.GetUserName();
- string uuid = ultraGrid1.ActiveRow.Cells["UUID_"].Text;
- arry.Add(str1);
- arry.Add(str2);
- arry.Add(str3);
- arry.Add(str4);
- arry.Add(str5);
- arry.Add(str6);
- arry.Add(str7);
- arry.Add(str8);
- arry.Add(str9);
- arry.Add(str10);
- arry.Add(str11);
- arry.Add(str12);
- arry.Add(str13);
- arry.Add(str14);
- arry.Add(str15);
- arry.Add(str16);
- arry.Add(str17);
- arry.Add(str18);
- arry.Add(str19);
- arry.Add(str20);
- arry.Add(str21);
- arry.Add(str22);
- arry.Add(str23);
- arry.Add(str24);
- arry.Add(str25);
- arry.Add(str26);
- arry.Add(str27);
- arry.Add(str28);
- arry.Add(str29);
- arry.Add(str30);
- arry.Add(str31);
- arry.Add(str32);
- arry.Add(str33);
- arry.Add(str34);
- arry.Add(str35);
- arry.Add(str36);
- arry.Add(str37);
- arry.Add(str38);
- arry.Add(str39);
- arry.Add(uuid);
- CommonClientToServer cctos = new CommonClientToServer();
- cctos.ob = this.ob;
- cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBSave",
- "doSimpleSave", arry, out strErr);
- this.proc_setCellReadOnly(currRow, true);
- currRow = null;
- bEditNow = false;
- }
- if (strErr == "")
- {
- dataTable1.AcceptChanges();
- //JJBStaticFunction.SetRowEdit(ultraGrid1);
- if (!string.IsNullOrEmpty(strMess))
- MessageBox.Show(strMess, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- else
- {
- MessageBox.Show("保存失败!输入信息已经存在或数据无效。", "错误");
- }
- if (ultraGrid1.ActiveCell != null)
- ultraGrid1.ActiveCell.Activated = false;
- this.proc_SetToolbarButtons();
- }
- }
- catch (System.Exception ex)
- {
- Console.WriteLine(ex.ToString());
- }
- }
- public void proc_Delete()
- {
- try
- {
- string strErr = "";
- ArrayList arry = new ArrayList();
- if (this.ultraGrid1.ActiveRow == null) return;
- string uuid_ = ultraGrid1.ActiveRow.Cells["UUID_"].Text.Trim();
- arry.Add("frmLzMaterial.Delete");
- arry.Add(uuid_);
- CommonClientToServer cctos = new CommonClientToServer();
- cctos.ob = this.ob;
- cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBSave",
- "doSimpleSave", arry, out strErr);
- if (!string.IsNullOrEmpty(strErr))
- {
- MessageBox.Show("删除错误:" + strErr);
- }
- else
- {
- MessageBox.Show("删除成功:" + strErr);
- }
- }
- catch { }
-
- }
- private void proc_SetToolbarButtons()
- {
- try
- {
- this.ToolBarItemEnable(this, "Query",!(bAddNow || bEditNow || bDelNow));
- this.ToolBarItemEnable(this, "Add", !(bAddNow || bEditNow || bDelNow));
- this.ToolBarItemEnable(this, "Edit", (!(bAddNow || bEditNow || bDelNow) && (ultraGrid1.ActiveRow != null)));
- this.ToolBarItemEnable(this, "Delete", (!(bAddNow || bEditNow || bDelNow) && (ultraGrid1.ActiveRow != null)));
- this.ToolBarItemEnable(this, "Export", (!(bAddNow || bEditNow || bDelNow) && ultraGrid1.Rows.Count > 0));
- this.ToolBarItemEnable(this, "Save", (bAddNow || bEditNow));
- this.ToolBarItemEnable(this, "Cancel", (bAddNow || bEditNow));
- //this.ToolBarVisible(this, "Save");
- //this.Toolbars[0].Tools["Save"].SharedProps.Visible = (bAddNow || bEditNow);
- //this.Toolbars[0].Tools["Cancel"].SharedProps.Visible = (bAddNow || bEditNow);
- }
- catch { }
- }
- private void proc_setCellReadOnly(UltraGridRow row, bool bReadOnly)
- {
- try
- {
- if (row == null)
- return;
- if (bReadOnly)
- {
- row.Activation = Activation.ActivateOnly;
- row.CellAppearance.BackColor = Color.White;
- foreach (Infragistics.Win.UltraWinGrid.UltraGridCell cell in row.Cells)
- {
- cell.CancelUpdate();
- }
- }
- else
- {
- row.Activation = Activation.AllowEdit;
- row.CellAppearance.BackColor = Color.Khaki;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- private void proc_SetUltraGridReadOnly(Infragistics.Win.UltraWinGrid.UltraGridBase ultGrid)
- {
- foreach (UltraGridRow row in ultGrid.Rows)
- {
- row.Activation = Activation.ActivateOnly;
- }
- }
- public void proc_Statics(ref UltraGrid ultraGrid, ArrayList alistColumns, bool clearExists, string strFormat)
- {
- try
- {
- if (alistColumns == null)
- {
- return;
- }
- UltraGridBand band = ultraGrid.DisplayLayout.Bands[0];
- if (clearExists)
- band.Summaries.Clear();
- SummarySettings summary = null;
- UltraGridColumn cl = null;
- foreach (UltraGridColumn column in ultraGrid.DisplayLayout.Bands[0].Columns)
- {
- if (column.RowLayoutColumnInfo.OriginX == 0)
- {
- cl = column;
- break;
- }
- }
- summary = band.Summaries.Add(SummaryType.Count, cl);
- summary.SummaryDisplayArea = SummaryDisplayAreas.BottomFixed;
- summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
- summary.DisplayFormat = "合计:";
- summary.Appearance.TextHAlign = Infragistics.Win.HAlign.Center;
- summary.Appearance.TextVAlign = Infragistics.Win.VAlign.Middle;
- summary.Appearance.FontData.Bold = DefaultableBoolean.True;
- if (string.IsNullOrEmpty(strFormat.Trim()))
- {
- strFormat = " {0:############0.00}";
- }
- for (int i = 0; i < alistColumns.Count; i++)
- {
- try
- {
- summary = band.Summaries.Add(SummaryType.Sum, band.Columns[alistColumns[i].ToString()]);
- summary.SummaryDisplayArea = SummaryDisplayAreas.BottomFixed;
- summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
- summary.DisplayFormat = strFormat;
- summary.Appearance.TextHAlign = Infragistics.Win.HAlign.Right;
- summary.Appearance.TextVAlign = Infragistics.Win.VAlign.Middle;
- summary.Appearance.FontData.Bold = DefaultableBoolean.True;
- summary.Appearance.ForeColor = Color.DarkBlue;
- summary.Appearance.BackColor = Color.White;
- }
- catch { }
- }
- band.Override.SummaryFooterCaptionVisible = Infragistics.Win.DefaultableBoolean.False;
- }
- catch { }
- }
- }
- }
|