F_RPT_040109.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. /*******************************************************************************
  2. * Copyright(c) 2015 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_RPT_040109.cs
  5. * 2.功能描述:整体质量分析表
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2016/11/09 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.Text;
  14. using System.Windows.Forms;
  15. using Dongke.IBOSS.PRD.Basics.BaseResources;
  16. using Dongke.IBOSS.PRD.Basics.DockPanel;
  17. using Dongke.IBOSS.PRD.Client.CommonModule;
  18. using Dongke.IBOSS.PRD.Client.Controls;
  19. using Dongke.IBOSS.PRD.Client.DataModels;
  20. using Dongke.IBOSS.PRD.WCF.DataModels;
  21. using Dongke.IBOSS.PRD.WCF.Proxys;
  22. namespace Dongke.IBOSS.PRD.Client.ReportModule
  23. {
  24. public partial class F_RPT_040109 : DKDockPanelBase
  25. {
  26. #region 成员变量
  27. // 窗体的单例模式
  28. private static F_RPT_040109 _instance;
  29. private DataTable g2DataTable = new DataTable();
  30. private DataTable g3DataTable = new DataTable();
  31. private int _minimumWidth = 40;
  32. #endregion
  33. #region 构造函数
  34. public F_RPT_040109()
  35. {
  36. InitializeComponent();
  37. // 窗体显示的Title
  38. //this.Text = FormTitles.F_RPT_040105;
  39. this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
  40. this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
  41. this.btnSearch.Text = ButtonText.BTN_SEARCH;
  42. this.btnClearCondition.Text = ButtonText.BTN_CLEARCONDITION;
  43. this.gbxCondition.Text = Constant.LABEL_QUERY_CONDITIONS;
  44. g2DataTable.Columns.Add("goodstypename2");
  45. g3DataTable.Columns.Add("goodstypename2");
  46. g2DataTable.Rows.Add(new object[] { "成品率(%)" });
  47. g3DataTable.Rows.Add(new object[] { "缺陷率(%)" });
  48. }
  49. #endregion
  50. #region 单例模式
  51. /// <summary>
  52. /// 单例模式,防止重复创建窗体
  53. /// </summary>
  54. public static F_RPT_040109 Instance
  55. {
  56. get
  57. {
  58. if (_instance == null || _instance.IsDisposed)
  59. {
  60. _instance = new F_RPT_040109();
  61. }
  62. return _instance;
  63. }
  64. }
  65. #endregion
  66. #region 事件处理
  67. /// <summary>
  68. /// 窗体加载事件
  69. /// </summary>
  70. /// <param name="sender"></param>
  71. /// <param name="e"></param>
  72. private void F_RPT_040104_Load(object sender, EventArgs e)
  73. {
  74. try
  75. {
  76. // 加载权限
  77. FormPermissionManager.FormPermissionControl(this.Name, this,
  78. LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
  79. LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
  80. //绑定下了列表
  81. BindPage();
  82. // 设置表格不自动创建列
  83. this.dgvTQ.AutoGenerateColumns = false;
  84. this.dgvFR.AutoGenerateColumns = false;
  85. this.dgvDR.AutoGenerateColumns = false;
  86. this.dgvDL.AutoGenerateColumns = false;
  87. this.dropRptProcedure.Focus();
  88. // 初始化时间控件为当前日期
  89. DateTime now = DateTime.Now.Date;
  90. this.dtpAccountDateStart.Value = now;
  91. this.dtpAccountDateEnd.Value = now.AddDays(1).AddSeconds(-1);
  92. //getPurviewLine();
  93. this.dgvFR.DataSource = this.g2DataTable;
  94. this.dgvDR.DataSource = this.g3DataTable;
  95. }
  96. catch (Exception ex)
  97. {
  98. // 对异常进行共通处理
  99. ExceptionManager.HandleEventException(this.ToString(),
  100. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  101. }
  102. }
  103. /// <summary>
  104. /// 自动适应列宽
  105. /// </summary>
  106. /// <param name="sender"></param>
  107. /// <param name="e"></param>
  108. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  109. {
  110. this.dgvTQ.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  111. this.dgvFR.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  112. this.dgvDR.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  113. this.dgvDL.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  114. }
  115. /// <summary>
  116. /// 窗体关闭事件
  117. /// </summary>
  118. /// <param name="sender"></param>
  119. /// <param name="e"></param>
  120. private void F_RPT_040104_FormClosed(object sender, FormClosedEventArgs e)
  121. {
  122. _instance = null;
  123. }
  124. /// <summary>
  125. /// 关闭按钮
  126. /// </summary>
  127. /// <param name="sender"></param>
  128. /// <param name="e"></param>
  129. private void tsbtnClose_Click(object sender, EventArgs e)
  130. {
  131. this.Close();
  132. }
  133. /// <summary>
  134. /// 查询按钮事件
  135. /// </summary>
  136. /// <param name="sender"></param>
  137. /// <param name="e"></param>
  138. private void btnSearch_Click(object sender, EventArgs e)
  139. {
  140. try
  141. {
  142. //this.tabcData.SelectedIndex = 0;
  143. //this.tabcData.Enabled = false;
  144. this.dgvFR.HorizontalMergeColumn = null;
  145. this.dgvTQ.DataSource = null;
  146. this.dgvFR.DataSource = this.g2DataTable;
  147. this.dgvDR.DataSource = this.g3DataTable;
  148. this.dgvDL.DataSource = null;
  149. List<string> removeAt = new List<string>();
  150. foreach (DataGridViewColumn item in this.dgvFR.Columns)
  151. {
  152. if (!item.Name.StartsWith("g"))
  153. {
  154. removeAt.Add(item.Name);
  155. }
  156. }
  157. foreach (string item in removeAt)
  158. {
  159. this.dgvFR.Columns.Remove(item);
  160. }
  161. removeAt.Clear();
  162. TreeNode top = this.g2TV.Nodes[0];
  163. this.g2TV.Nodes.Clear();
  164. this.g2TV.Nodes.Add(top);
  165. top = this.g3TV.Nodes[0];
  166. this.g3TV.Nodes.Clear();
  167. this.g3TV.Nodes.Add(top);
  168. foreach (DataGridViewColumn item in this.dgvDR.Columns)
  169. {
  170. if (!item.Name.StartsWith("g"))
  171. {
  172. removeAt.Add(item.Name);
  173. }
  174. }
  175. foreach (string item in removeAt)
  176. {
  177. this.dgvDR.Columns.Remove(item);
  178. }
  179. removeAt.Clear();
  180. foreach (DataGridViewColumn item in this.dgvDL.Columns)
  181. {
  182. if (!item.Name.StartsWith("g"))
  183. {
  184. removeAt.Add(item.Name);
  185. }
  186. }
  187. foreach (string item in removeAt)
  188. {
  189. this.dgvDL.Columns.Remove(item);
  190. }
  191. removeAt.Clear();
  192. DataSet dataSet = this.GetSearchData();
  193. if (dataSet == null)
  194. {
  195. return;
  196. }
  197. List<string> colHB = new List<string>();
  198. foreach (DataRow item in dataSet.Tables["DT"].Rows)
  199. {
  200. List<int> colHBCell = new List<int>();
  201. string dtID = "T" + item["defecttypeid"].ToString();
  202. string dtName = item["defecttypeName"].ToString();
  203. // 缺陷排行
  204. DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn();
  205. col.Name = "a4" + dtID;
  206. col.HeaderText = dtName;
  207. col.DataPropertyName = dtID;
  208. DataGridViewCellStyle dgvcs = new System.Windows.Forms.DataGridViewCellStyle();
  209. dgvcs.Alignment = DataGridViewContentAlignment.MiddleRight;
  210. dgvcs.NullValue = "0";
  211. dgvcs.Format = "N0";
  212. col.DefaultCellStyle = dgvcs;
  213. col.ReadOnly = true;
  214. this.dgvDL.Columns.Add(col);
  215. // 成品率
  216. #region 成品率
  217. TreeNode tnDTA2 = new TreeNode(dtName);
  218. tnDTA2.Name = "a2" + dtID;
  219. DataRow[] wgs = dataSet.Tables["WG"].Select("defecttypeid = " + item["defecttypeid"]);
  220. if (wgs == null || wgs.Length == 0)
  221. {
  222. foreach (DataRow drDF in dataSet.Tables["DF"].Rows)
  223. {
  224. string dfID = "F" + drDF["defectfineid"];
  225. string dfName = drDF["defectfinecode"].ToString();
  226. TreeNode tnDF = new TreeNode(dfName);
  227. tnDF.Name = tnDTA2.Name + "W" + dfID;
  228. tnDTA2.Nodes.Add(tnDF);
  229. DataGridViewTextBoxColumn colDF = new DataGridViewTextBoxColumn();
  230. colDF.Name = tnDF.Name;
  231. colDF.MinimumWidth = this._minimumWidth;
  232. colDF.HeaderText = tnDF.Text;
  233. colDF.DataPropertyName = dtID + "W" + dfID;
  234. DataGridViewCellStyle dgvcsDF = new System.Windows.Forms.DataGridViewCellStyle();
  235. dgvcsDF.Alignment = DataGridViewContentAlignment.MiddleRight;
  236. colDF.DefaultCellStyle = dgvcsDF;
  237. colDF.SortMode = DataGridViewColumnSortMode.NotSortable;
  238. colDF.ReadOnly = true;
  239. this.dgvFR.Columns.Add(colDF);
  240. colHBCell.Add(colDF.Index);
  241. }
  242. }
  243. else
  244. {
  245. foreach (DataRow drWG in wgs)
  246. {
  247. string wgID = "W" + drWG["workergroupid"];
  248. string wgName = drWG["workergroupName"].ToString();
  249. TreeNode tnWG = new TreeNode(wgName);
  250. tnWG.Name = tnDTA2.Name + wgID;
  251. tnDTA2.Nodes.Add(tnWG);
  252. foreach (DataRow drDF in dataSet.Tables["DF"].Rows)
  253. {
  254. string dfID = "F" + drDF["defectfineid"];
  255. string dfName = drDF["defectfinecode"].ToString();
  256. TreeNode tnDF = new TreeNode(dfName);
  257. tnDF.Name = tnWG.Name + dfID;
  258. tnWG.Nodes.Add(tnDF);
  259. DataGridViewTextBoxColumn colDF = new DataGridViewTextBoxColumn();
  260. colDF.Name = tnDF.Name;
  261. colDF.HeaderText = tnDF.Text;
  262. colDF.MinimumWidth = this._minimumWidth;
  263. colDF.DataPropertyName = dtID + wgID + dfID;
  264. DataGridViewCellStyle dgvcsDF = new System.Windows.Forms.DataGridViewCellStyle();
  265. dgvcsDF.Alignment = DataGridViewContentAlignment.MiddleRight;
  266. colDF.DefaultCellStyle = dgvcsDF;
  267. colDF.ReadOnly = true;
  268. colDF.SortMode = DataGridViewColumnSortMode.NotSortable;
  269. this.dgvFR.Columns.Add(colDF);
  270. colHBCell.Add(colDF.Index);
  271. }
  272. }
  273. }
  274. this.g2TV.Nodes.Add(tnDTA2);
  275. colHB.Add(string.Join(",", colHBCell.ToArray()));
  276. #endregion
  277. // 缺陷率
  278. #region 缺陷率
  279. DataRow[] tdr = dataSet.Tables["DR1"].Select("tid = '" + dtID + "'");
  280. string dta3Name = dtName;
  281. if (tdr != null && tdr.Length > 0)
  282. {
  283. //dta3Name += Convert.ToDecimal(tdr[0]["DefectRate"]).ToString("(#,##0.00%)");
  284. dta3Name += (tdr[0]["DefectRate"] == DBNull.Value ? "(" + Constant.DIV0 + ")" : Convert.ToDecimal(tdr[0]["DefectRate"]).ToString("(#,##0.00%)"));
  285. }
  286. else
  287. {
  288. dta3Name += "(0.00%)";
  289. }
  290. TreeNode tnDTA3 = new TreeNode(dta3Name);
  291. tnDTA3.Name = "a3" + dtID;
  292. DataRow[] ds = dataSet.Tables["D"].Select("defectid is not null and defecttypeid = " + item["defecttypeid"]);
  293. if (ds == null || ds.Length == 0)
  294. {
  295. foreach (DataRow drDF in dataSet.Tables["DF"].Rows)
  296. {
  297. string dfID = "F" + drDF["defectfineid"];
  298. string dfName = drDF["defectfinecode"].ToString();
  299. TreeNode tnDF = new TreeNode(dfName);
  300. tnDF.Name = tnDTA3.Name + "D" + dfID;
  301. tnDTA3.Nodes.Add(tnDF);
  302. DataGridViewTextBoxColumn colDF = new DataGridViewTextBoxColumn();
  303. colDF.Name = tnDF.Name;
  304. colDF.HeaderText = tnDF.Text;
  305. colDF.MinimumWidth = this._minimumWidth;
  306. colDF.DataPropertyName = dtID + "D" + dfID;
  307. DataGridViewCellStyle dgvcsDF = new System.Windows.Forms.DataGridViewCellStyle();
  308. dgvcsDF.Alignment = DataGridViewContentAlignment.MiddleRight;
  309. colDF.DefaultCellStyle = dgvcsDF;
  310. colDF.SortMode = DataGridViewColumnSortMode.NotSortable;
  311. colDF.ReadOnly = true;
  312. this.dgvDR.Columns.Add(colDF);
  313. }
  314. }
  315. else
  316. {
  317. foreach (DataRow drD in ds)
  318. {
  319. string dID = "D" + drD["defectid"];
  320. string dName = drD["defectname"].ToString();
  321. TreeNode tnD = new TreeNode(dName);
  322. tnD.Name = tnDTA3.Name + dID;
  323. tnDTA3.Nodes.Add(tnD);
  324. foreach (DataRow drDF in dataSet.Tables["DF"].Rows)
  325. {
  326. string dfID = "F" + drDF["defectfineid"];
  327. string dfName = drDF["defectfinecode"].ToString();
  328. TreeNode tnDF = new TreeNode(dfName);
  329. tnDF.Name = tnD.Name + dfID;
  330. tnD.Nodes.Add(tnDF);
  331. DataGridViewTextBoxColumn colDF = new DataGridViewTextBoxColumn();
  332. colDF.Name = tnDF.Name;
  333. colDF.HeaderText = tnDF.Text;
  334. colDF.MinimumWidth = this._minimumWidth;
  335. colDF.DataPropertyName = dtID + dID + dfID;
  336. DataGridViewCellStyle dgvcsDF = new System.Windows.Forms.DataGridViewCellStyle();
  337. dgvcsDF.Alignment = DataGridViewContentAlignment.MiddleRight;
  338. colDF.DefaultCellStyle = dgvcsDF;
  339. colDF.SortMode = DataGridViewColumnSortMode.NotSortable;
  340. colDF.ReadOnly = true;
  341. this.dgvDR.Columns.Add(colDF);
  342. }
  343. }
  344. }
  345. this.g3TV.Nodes.Add(tnDTA3);
  346. #endregion
  347. }
  348. this.dgvTQ.DataSource = dataSet.Tables["TQ"];
  349. this.dgvFR.DataSource = dataSet.Tables["FR"];
  350. this.dgvDR.DataSource = dataSet.Tables["DR"];
  351. this.dgvDL.DataSource = dataSet.Tables["DL"];
  352. this.dgvFR.HorizontalMergeColumn = new Dictionary<int, List<string>>();
  353. //colHB.Insert(0, "0");
  354. //this.dgvFR.HorizontalMergeColumn.Add(this.dgvFR.RowCount - 1, colHB);
  355. int index = (this.dgvFR.RowCount - 1) / 2;
  356. if (index < 0)
  357. {
  358. index = 0;
  359. }
  360. for (int i = index; i < this.dgvFR.RowCount; i++)
  361. {
  362. this.dgvFR.HorizontalMergeColumn.Add(i, colHB);
  363. }
  364. this.tsbtnAdaptive_Click(null, null);
  365. }
  366. catch (Exception ex)
  367. {
  368. this.btnSearch.Enabled = true;
  369. this.btnClearCondition.Enabled = true;
  370. // 对异常进行共通处理
  371. ExceptionManager.HandleEventException(this.ToString(),
  372. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  373. }
  374. finally
  375. {
  376. this.btnSearch.Enabled = true;
  377. this.btnClearCondition.Enabled = true;
  378. this.tabcData.Enabled = true;
  379. this.dgvTQ.Enabled = true;
  380. this.dgvFR.Enabled = true;
  381. this.dgvDR.Enabled = true;
  382. this.dgvDL.Enabled = true;
  383. }
  384. }
  385. /// <summary>
  386. /// 清空条件按钮事件
  387. /// </summary>
  388. /// <param name="sender"></param>
  389. /// <param name="e"></param>
  390. private void btnClearCondition_Click(object sender, EventArgs e)
  391. {
  392. this.dropKilnCode.SelectedIndex = 0;
  393. DateTime now = DateTime.Now.Date;
  394. this.dtpAccountDateStart.Value = now;
  395. this.dtpAccountDateEnd.Value = now.AddDays(1).AddSeconds(-1);
  396. }
  397. #endregion
  398. #region 私有方法
  399. /// <summary>
  400. /// 根据界面查询条件获取数据集
  401. /// </summary>
  402. private DataSet GetSearchData()
  403. {
  404. try
  405. {
  406. RPT040109_SE se = new RPT040109_SE();
  407. if (string.IsNullOrEmpty(this.dropRptProcedure.Text))
  408. {
  409. this.dropRptProcedure.Focus();
  410. return null;
  411. }
  412. se.RptProcedureID = Convert.ToInt32(this.dropRptProcedure.SelectedValue);
  413. //获取数据来源工序Id
  414. ServiceResultEntity sre0 = this.DoAsync<ServiceResultEntity>(() =>
  415. {
  416. return ReportModuleProxy.Service.GetRptSourceProcedureModule(se.RptProcedureID);
  417. }
  418. );
  419. if (sre0.Data != null && sre0.Data.Tables.Count > 0)
  420. {
  421. se.RptSProcedureID = int.Parse(sre0.Data.Tables[0].Rows[Constant.INT_IS_ZERO]["Procedureid"].ToString());
  422. }
  423. //获取数据来源工序Id
  424. if (!this.dropKilnCode.Text.Equals(Constant.CBO_SELECT_ALL_NAME))
  425. {
  426. se.KilnID = Convert.ToInt32(this.dropKilnCode.SelectedValue);
  427. }
  428. //se.CreateTimeStart = DateTime.Parse(this.dtpAccountDateStart.Value.ToString("yyyy-MM-dd") + " 00:00:00");
  429. //se.CreateTimeEnd = DateTime.Parse(this.dtpAccountDateEnd.Value.ToString("yyyy-MM-dd") + " 23:59:59");
  430. se.CreateTimeStart = this.dtpAccountDateStart.Value;
  431. se.CreateTimeEnd = this.dtpAccountDateEnd.Value;
  432. se.HasUserGroup = this.chkUserGroup.Checked;
  433. // 调用服务器端获取数据集
  434. ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
  435. {
  436. return ReportModuleProxy.Service.GetRPT040109SData(se);
  437. }
  438. );
  439. if (sre.Status == Constant.ServiceResultStatus.Success)
  440. {
  441. if (sre.Data.Tables[0].Rows.Count <= Constant.INT_IS_ZERO)
  442. {
  443. // 提示未查找到数据
  444. MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  445. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  446. //清空数据
  447. return null;
  448. }
  449. return sre.Data;
  450. }
  451. return null;
  452. }
  453. catch (Exception ex)
  454. {
  455. throw ex;
  456. }
  457. }
  458. /// <summary>
  459. /// 绑定下拉列表值
  460. /// </summary>
  461. /// <returns></returns>
  462. private void BindPage()
  463. {
  464. //绑定数据来源下拉列表
  465. ServiceResultEntity sre1 = DoAsync<ServiceResultEntity>(() =>
  466. {
  467. return ReportModuleProxy.Service.GetRptProcedureModule();
  468. }
  469. );
  470. this.dropRptProcedure.DataSource = sre1.Data.Tables[Constant.INT_IS_ZERO];
  471. this.dropRptProcedure.ValueMember = "Rptprocedureid";
  472. this.dropRptProcedure.DisplayMember = "Rptprocedurename";
  473. //绑定窑炉下来列表
  474. ServiceResultEntity sre2 = DoAsync<ServiceResultEntity>(() =>
  475. {
  476. byte byFlage = Convert.ToByte(Constant.ValueFlag.Invalid);
  477. return ReportModuleProxy.Service.GetKilnData(byFlage);
  478. }
  479. );
  480. DataTable dtKilnInfo = sre2.Data.Tables[Constant.INT_IS_ZERO];
  481. DataRow newRowDic = dtKilnInfo.NewRow();
  482. newRowDic["KilnID"] = Constant.CBO_SELECT_ALL_VALUE;
  483. newRowDic["KilnCode"] = Constant.CBO_SELECT_ALL_NAME;
  484. dtKilnInfo.Rows.InsertAt(newRowDic, Constant.INT_IS_ZERO);
  485. this.dropKilnCode.DataSource = dtKilnInfo;
  486. this.dropKilnCode.ValueMember = "KilnID";
  487. this.dropKilnCode.DisplayMember = "KilnCode";
  488. }
  489. #endregion
  490. /// <summary>
  491. /// 导出
  492. /// </summary>
  493. /// <param name="sender"></param>
  494. /// <param name="e"></param>
  495. private void tsbtnExport_Click(object sender, EventArgs e)
  496. {
  497. try
  498. {
  499. int si = this.tabcData.SelectedIndex;
  500. this.tabcData.SelectedIndex = 0;
  501. this.tabcData.SelectedIndex = 1;
  502. this.tabcData.SelectedIndex = 2;
  503. this.tabcData.SelectedIndex = 3;
  504. this.tabcData.SelectedIndex = si;
  505. // 多个sheet页
  506. List<DataGridView> dgvList = new List<DataGridView>();
  507. List<TreeView> tvList = new List<TreeView>();
  508. List<string> sheetList = new List<string>();
  509. dgvList.Add(this.dgvTQ);
  510. dgvList.Add(this.dgvFR);
  511. dgvList.Add(this.dgvDR);
  512. dgvList.Add(this.dgvDL);
  513. tvList.Add(null);
  514. tvList.Add(this.dgvFR.ColumnTreeView[0]);
  515. tvList.Add(this.dgvDR.ColumnTreeView[0]);
  516. tvList.Add(null);
  517. sheetList.Add(this.tabcData.TabPages[0].Text);
  518. sheetList.Add(this.tabcData.TabPages[1].Text);
  519. sheetList.Add(this.tabcData.TabPages[2].Text);
  520. sheetList.Add(this.tabcData.TabPages[3].Text);
  521. ExportExcel.Common.Instance.ExportExcel(dgvList, tvList, null, this.Text, this.Text, this.Font, "", this.Font, "", sheetList, true, true, true, this.dgvFR.IsTopDeep);
  522. //ExportExcel.Common.Instance.ExportExcelOneSheet(dgvList, tvList, null, this.Text, this.Text, this.Font, "", this.Font, "", sheetList, true, true, this.dgvFR.IsTopDeep);
  523. }
  524. catch (Exception ex)
  525. {
  526. // 对异常进行共通处理
  527. ExceptionManager.HandleEventException(this.ToString(),
  528. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  529. }
  530. }
  531. }
  532. }