NationalStandardMethodTwo.cs 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using OTSCLRINTERFACE;
  11. using System.Collections;
  12. using OTSCommon;
  13. using OTSIncAReportApp.ReportTemplate;
  14. using OTSIncAReportApp;
  15. using OTSIncAReportApp.OTSSampleReportInfo;
  16. namespace OTSIncAReportGB
  17. {
  18. public partial class NationalStandardMethodTwo : UserControl
  19. {
  20. #region 全局变量
  21. //设置数据表
  22. public DataTable m_dt_A = new DataTable();
  23. public DataTable m_dt_B = new DataTable();
  24. public DataTable m_dt_C = new DataTable();
  25. public DataTable m_dt_D = new DataTable();
  26. public DataTable m_dt_sulfide = new DataTable();
  27. public DataTable m_dt_DS = new DataTable();
  28. public List<DataTable> m_dt_dall = new List<DataTable>();
  29. //底层相关,项目操作管理类
  30. CReportMgrClr m_ReportMgrClr = null;
  31. //获取从框架得到的底层计算结果,国标表A
  32. List<CGridDataClr> m_list_cgriddataclr_A = null;
  33. //获取从框架得到的底层计算结果,国标表B
  34. List<CGridDataClr> m_list_cgriddataclr_B = null;
  35. //获取从框架得到的底层计算结果,国标表C
  36. List<CGridDataClr> m_list_cgriddataclr_C = null;
  37. //获取从框架得到的底层计算结果,国标表D
  38. List<CGridDataClr> m_list_cgriddataclr_D = null;
  39. //获取从框架得到的底层计算结果,国标表D硫化物表
  40. List<CGridDataClr> m_list_cgriddataclr_sulfide = null;
  41. //获取从框架得到的底层计算结果,国标表DS
  42. List<CGridDataClr> m_list_cgriddataclr_DS = null;
  43. //定义一个组List
  44. List<CGridDataClr> m_list_ALLTwo = null;
  45. //接收底层数据
  46. public List<CGridDataClr> DataAll;
  47. //一个数据源包含几个列数的记录数
  48. private int m_oneresult_columnscount_A = 3;
  49. private int m_oneresult_columnscount_B = 3;
  50. private int m_oneresult_columnscount_C = 3;
  51. private int m_oneresult_columnscount_D = 3;
  52. private int m_oneresult_columnscount_sulfide = 3;
  53. private int m_oneresult_columnscount_DS = 3;
  54. string str_result = "";
  55. #endregion
  56. #region 自定义方法
  57. private void SetDataGridViewStyleAll()
  58. {
  59. //用户不能调整标题的高度
  60. Gview_gzA.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
  61. //用户不能调整 行高
  62. Gview_gzA.AllowUserToResizeRows = false;
  63. //改变行的高度;
  64. //Gview_gz.RowTemplate.Height = 20;
  65. //点击选择整行
  66. Gview_gzA.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
  67. //居中显示
  68. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
  69. dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
  70. Gview_gzA.DefaultCellStyle = dataGridViewCellStyle1;
  71. Gview_gzA.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  72. //再次重覆禁用拖动表头高度,居然有效果了
  73. Gview_gzA.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
  74. //设置grid可以复制
  75. Gview_gzA.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
  76. }
  77. /// <summary>
  78. /// 设置DataGridView样式,B类表
  79. /// </summary>
  80. private void SetDataGridViewStyleB()
  81. {
  82. //用户不能调整标题的高度
  83. Gview_gzB.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
  84. //用户不能调整 行高
  85. Gview_gzB.AllowUserToResizeRows = false;
  86. //改变行的高度;
  87. //Gview_gz.RowTemplate.Height = 20;
  88. //点击选择整行
  89. Gview_gzB.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
  90. //居中显示
  91. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
  92. dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
  93. Gview_gzB.DefaultCellStyle = dataGridViewCellStyle1;
  94. Gview_gzB.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  95. //再次重覆禁用拖动表头高度,居然有效果了
  96. Gview_gzB.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
  97. //设置grid可以复制
  98. Gview_gzB.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
  99. //设置每列的宽度
  100. Gview_gzB.Columns[0].Width = 40;//第一列序号的宽度设置一下吧,要不太丑
  101. //设置序号列不排序
  102. Gview_gzB.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
  103. //设置序号列不可以设置宽度
  104. Gview_gzB.Columns[0].Resizable = DataGridViewTriState.False;
  105. }
  106. /// <summary>
  107. /// 设置DataGridView样式,C类表
  108. /// </summary>
  109. private void SetDataGridViewStyleC()
  110. {
  111. //用户不能调整标题的高度
  112. Gview_gzC.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
  113. //用户不能调整 行高
  114. Gview_gzC.AllowUserToResizeRows = false;
  115. //改变行的高度;
  116. //Gview_gz.RowTemplate.Height = 20;
  117. //点击选择整行
  118. Gview_gzC.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
  119. //居中显示
  120. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
  121. dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
  122. Gview_gzC.DefaultCellStyle = dataGridViewCellStyle1;
  123. Gview_gzC.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  124. //再次重覆禁用拖动表头高度,居然有效果了
  125. Gview_gzC.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
  126. //设置grid可以复制
  127. Gview_gzC.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
  128. //设置每列的宽度
  129. Gview_gzC.Columns[0].Width = 40;//第一列序号的宽度设置一下吧,要不太丑
  130. //设置序号列不排序
  131. Gview_gzC.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
  132. //设置序号列不可以设置宽度
  133. Gview_gzC.Columns[0].Resizable = DataGridViewTriState.False;
  134. }
  135. /// <summary>
  136. /// 设置DataGridView样式,D类表
  137. /// </summary>
  138. private void SetDataGridViewStyleD()
  139. {
  140. //用户不能调整标题的高度
  141. Gview_gzD.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
  142. //用户不能调整 行高
  143. Gview_gzD.AllowUserToResizeRows = false;
  144. //改变行的高度;
  145. //Gview_gz.RowTemplate.Height = 20;
  146. //点击选择整行
  147. Gview_gzD.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
  148. //居中显示
  149. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
  150. dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
  151. Gview_gzD.DefaultCellStyle = dataGridViewCellStyle1;
  152. Gview_gzD.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  153. //再次重覆禁用拖动表头高度,居然有效果了
  154. Gview_gzD.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
  155. //设置grid可以复制
  156. Gview_gzD.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
  157. //设置每列的宽度
  158. Gview_gzD.Columns[0].Width = 40;//第一列序号的宽度设置一下吧,要不太丑
  159. //设置序号列不排序
  160. Gview_gzD.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
  161. //设置序号列不可以设置宽度
  162. Gview_gzD.Columns[0].Resizable = DataGridViewTriState.False;
  163. }
  164. /// <summary>
  165. /// 设置DataGridView样式,DS类表
  166. /// </summary>
  167. private void SetDataGridViewStyleDS()
  168. {
  169. //用户不能调整标题的高度
  170. Gview_gzDS.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
  171. //用户不能调整 行高
  172. Gview_gzDS.AllowUserToResizeRows = false;
  173. //改变行的高度;
  174. //Gview_gz.RowTemplate.Height = 20;
  175. //点击选择整行
  176. Gview_gzDS.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
  177. //居中显示
  178. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
  179. dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
  180. Gview_gzDS.DefaultCellStyle = dataGridViewCellStyle1;
  181. Gview_gzDS.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  182. //再次重覆禁用拖动表头高度,居然有效果了
  183. Gview_gzDS.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
  184. //设置grid可以复制
  185. Gview_gzDS.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
  186. //设置每列的宽度
  187. Gview_gzDS.Columns[0].Width = 40;//第一列序号的宽度设置一下吧,要不太丑
  188. //设置序号列不排序
  189. Gview_gzDS.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
  190. //设置序号列不可以设置宽度
  191. Gview_gzDS.Columns[0].Resizable = DataGridViewTriState.False;
  192. }
  193. #endregion
  194. #region 窗体加载及初始化
  195. public NationalStandardMethodTwo()
  196. {
  197. InitializeComponent();
  198. }
  199. /// <summary>
  200. /// 国标报表,构造函数,接收A,B,C,D,DS五种结果,并进行显示
  201. /// </summary>
  202. /// <param name="in_sec"></param>
  203. /// <param name="in_Cotsreportprojfilemgrclr"></param>
  204. /// <param name="in_list_CGridDataClrAll"></param> //all 代表A、B、C、D、DS按顺序得表
  205. public string ColumnName;
  206. public string RowName;
  207. #region 国际化语言
  208. Language lan;
  209. Hashtable table;
  210. #endregion
  211. public NationalStandardMethodTwo(CReportMgrClr in_Cotsreportprojfilemgrclr, List<CGridDataClr> in_list_CGridDataClrAll)
  212. {
  213. DataAll = in_list_CGridDataClrAll;
  214. //获取报告项目类对象
  215. m_ReportMgrClr = in_Cotsreportprojfilemgrclr;
  216. m_list_cgriddataclr_A = in_list_CGridDataClrAll.GetRange(0, 1);
  217. m_list_cgriddataclr_B = in_list_CGridDataClrAll.GetRange(1, 1);
  218. m_list_cgriddataclr_C = in_list_CGridDataClrAll.GetRange(2, 1);
  219. m_list_cgriddataclr_D = in_list_CGridDataClrAll.GetRange(3, 1);
  220. m_list_cgriddataclr_sulfide = in_list_CGridDataClrAll.GetRange(4, 1);
  221. m_list_cgriddataclr_DS = in_list_CGridDataClrAll.GetRange(5, 1);
  222. m_list_ALLTwo = in_list_CGridDataClrAll;
  223. InitializeComponent();
  224. #region 国际化语言
  225. lan = new Language(this);
  226. table = lan.GetNameTable(this.Name);
  227. #endregion
  228. log_1.Text = "";
  229. log_2.Text = "";
  230. log_3.Text = "";
  231. log_4.Text = "";
  232. log_5.Text = "";
  233. //log_6.Text = "";
  234. log_1_1.Text = "";
  235. log_2_1.Text = "";
  236. log_3_1.Text = "";
  237. log_4_1.Text = "";
  238. log_5_1.Text = "";
  239. //log_6_1.Text = "";
  240. }
  241. private void NationalStandardMethodTwo_Load(object sender, EventArgs e)
  242. {
  243. //从底层结果类对象中,分解出数据保存到datatable中
  244. if (m_list_ALLTwo.Count > 7)
  245. {
  246. int SouseData = (m_ReportMgrClr.GetSmplMsrResultMgrs().Count) * 7;
  247. for (int g = 0; g < m_ReportMgrClr.GetSmplMsrResultMgrs().Count; g++)
  248. {
  249. for (int i = 0; i < 6; i++)
  250. {
  251. DataTable dt = new DataTable();
  252. DataColumn cc = new DataColumn();
  253. int q = g * 7 + i;
  254. dt = ChineseStandardABCD_GetDataTable_Total(DataAll.GetRange(q, 1), out m_oneresult_columnscount_A);
  255. DataGridView aa = new DataGridView();
  256. int start = 68;
  257. int end = 0;
  258. end = 150 * q;
  259. aa.Location = new Point(start, end);
  260. aa.Width = panel1.Width;
  261. aa.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
  262. aa.BackgroundColor = Color.White;
  263. panel1.Controls.Add(aa);
  264. aa.DataSource = dt;
  265. aa.Name = i.ToString();
  266. Label bb = new Label();
  267. int startLabel = 0;
  268. int endLabel = 0;
  269. endLabel = 150 * q;
  270. bb.Location = new Point(startLabel, endLabel);
  271. bb.Width = 75;
  272. for (int t = 0; t < SouseData; t++)
  273. {
  274. if (i == t * 6)
  275. {
  276. bb.Text = table["label1"].ToString();
  277. break;
  278. }
  279. if (i == t * 6 + 1)
  280. {
  281. bb.Text = table["label2"].ToString();
  282. }
  283. if (i == t * 6 + 2)
  284. {
  285. bb.Text = table["label3"].ToString();
  286. }
  287. if (i == t * 6 + 3)
  288. {
  289. bb.Text = table["label4"].ToString();
  290. }
  291. if (i == t * 6 + 4)
  292. {
  293. bb.Text = table["label5"].ToString();
  294. }
  295. if (i == t * 6 + 5)
  296. {
  297. bb.Text = table["label6"].ToString();
  298. }
  299. }
  300. bb.Font = new Font(bb.Font.Name, 12, FontStyle.Bold | FontStyle.Underline);
  301. panel1.Controls.Add(bb);
  302. }
  303. }
  304. Gview_gzA.Visible = false;
  305. Gview_gzB.Visible = false;
  306. Gview_gzC.Visible = false;
  307. Gview_gzD.Visible = false;
  308. sulfide.Visible = false;
  309. Gview_gzDS.Visible = false;
  310. label1.Visible = false;
  311. label2.Visible = false;
  312. label3.Visible = false;
  313. label4.Visible = false;
  314. label5.Visible = false;
  315. label6.Visible = false;
  316. Invalidate();
  317. }
  318. else
  319. {
  320. m_dt_A = ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_A, out m_oneresult_columnscount_A);
  321. m_dt_B = ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_B, out m_oneresult_columnscount_B);
  322. m_dt_C = ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_C, out m_oneresult_columnscount_C);
  323. m_dt_D = ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_D, out m_oneresult_columnscount_D);
  324. m_dt_sulfide = ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_sulfide, out m_oneresult_columnscount_sulfide);
  325. m_dt_DS = ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_DS, out m_oneresult_columnscount_DS);
  326. m_dt_dall.Add(m_dt_A);
  327. m_dt_dall.Add(m_dt_B);
  328. m_dt_dall.Add(m_dt_C);
  329. m_dt_dall.Add(m_dt_D);
  330. m_dt_dall.Add(m_dt_sulfide);
  331. m_dt_dall.Add(m_dt_DS);
  332. DataView dv = m_dt_DS.DefaultView;
  333. dv.Sort = "Grade desc";
  334. DataTable dt_DS_data = dv.ToTable();
  335. Gview_gzA.DataSource = m_dt_A;
  336. for (int i = 0; i < 13; i++)
  337. {
  338. Gview_gzA.Columns[i].Width = 68;
  339. }
  340. Gview_gzB.DataSource = m_dt_B;
  341. for (int i = 0; i < 13; i++)
  342. {
  343. Gview_gzB.Columns[i].Width = 68;
  344. }
  345. Gview_gzC.DataSource = m_dt_C;
  346. for (int i = 0; i < 13; i++)
  347. {
  348. Gview_gzC.Columns[i].Width = 68;
  349. }
  350. Gview_gzD.DataSource = m_dt_D;
  351. for (int i = 0; i < 13; i++)
  352. {
  353. Gview_gzD.Columns[i].Width = 68;
  354. }
  355. sulfide.DataSource = m_dt_sulfide;
  356. for (int i = 0; i < 13; i++)
  357. {
  358. sulfide.Columns[i].Width = 68;
  359. }
  360. Gview_gzDS.DataSource = dt_DS_data;
  361. Gview_gzA.Width = panel1.Width;
  362. Gview_gzB.Width = panel1.Width;
  363. Gview_gzC.Width = panel1.Width;
  364. Gview_gzD.Width = panel1.Width;
  365. sulfide.Width = panel1.Width;
  366. Gview_gzDS.Width = panel1.Width;
  367. int it = 0;
  368. if(DetermineWhetherImprovementIsNeeded("A类", m_dt_A))
  369. {
  370. str_result = str_result + "夹杂物评级达到2.0:表明钢中的MnS或硫化物夹杂物控制不够理想。" +
  371. "针对这一问题,我们建议您在相关工艺上进行优化和改进。";
  372. LabelAssignment(it);
  373. it++;
  374. str_result = "";
  375. }
  376. if(DetermineWhetherImprovementIsNeeded("B类", m_dt_B))
  377. {
  378. str_result = str_result + "夹杂物评级达到2.0:表明钢中的铝酸盐或其他不变形氧化物夹杂物控制不够理想。" +
  379. "针对这一问题,我们建议您在相关工艺上进行优化和改进。";
  380. LabelAssignment(it);
  381. it++;
  382. str_result = "";
  383. }
  384. if(DetermineWhetherImprovementIsNeeded("C类", m_dt_C))
  385. {
  386. str_result = str_result + "夹杂物评级达到2.0:表明钢中的硅酸盐过其他可变性氧化物夹杂物控制不够理想。" +
  387. "针对这一问题,我们建议您在相关工艺上进行优化和改进。";
  388. LabelAssignment(it);
  389. it++;
  390. str_result = "";
  391. }
  392. if (DetermineWhetherImprovementIsNeeded("D类", m_dt_D))
  393. {
  394. str_result = str_result + "夹杂物评级达到2.0:表明钢中的单颗粒球状氧化物夹杂物控制不够理想。" +
  395. "针对这一问题,我们建议您在相关工艺上进行优化和改进。";
  396. LabelAssignment(it);
  397. it++;
  398. str_result = "";
  399. }
  400. if (DetermineWhetherImprovementIsNeeded("D硫化物类", m_dt_sulfide))
  401. {
  402. str_result = str_result + "夹杂物评级达到2.0:表明钢中的球状硫化物夹杂物控制不够理想。" +
  403. "针对这一问题,我们建议您在相关工艺上进行优化和改进。";
  404. LabelAssignment(it);
  405. it++;
  406. str_result = "";
  407. }
  408. }
  409. button_preview.Location = new Point(Gview_gzA.Location.X + Gview_gzA.Width + 20, Gview_gzA.Location.Y - 10);
  410. Invalidate();
  411. }
  412. private void LabelAssignment(int it)
  413. {
  414. if (it == 0)
  415. {
  416. log_1.Text = str_result;
  417. log_1_1.Text = "为了获取更具体的改进措施,您可以随时联系我们公司的软件售后服务团队," +
  418. "我们的炼钢工艺专家将为您提供专业的建议和支持。";
  419. }
  420. else if (it == 1)
  421. {
  422. log_2.Text = str_result;
  423. log_2_1.Text = "为了获取更具体的改进措施,您可以随时联系我们公司的软件售后服务团队," +
  424. "我们的炼钢工艺专家将为您提供专业的建议和支持。";
  425. }
  426. else if (it == 2)
  427. {
  428. log_3.Text = str_result;
  429. log_3_1.Text = "为了获取更具体的改进措施,您可以随时联系我们公司的软件售后服务团队," +
  430. "我们的炼钢工艺专家将为您提供专业的建议和支持。";
  431. }
  432. else if (it == 3)
  433. {
  434. log_4.Text = str_result;
  435. log_4_1.Text = "为了获取更具体的改进措施,您可以随时联系我们公司的软件售后服务团队," +
  436. "我们的炼钢工艺专家将为您提供专业的建议和支持。";
  437. }
  438. else if (it == 4)
  439. {
  440. log_5.Text = str_result;
  441. log_5_1.Text = "为了获取更具体的改进措施,您可以随时联系我们公司的软件售后服务团队," +
  442. "我们的炼钢工艺专家将为您提供专业的建议和支持。";
  443. }
  444. }
  445. private bool DetermineWhetherImprovementIsNeeded(string str, DataTable data)
  446. {
  447. string Thin = ""; string Thick = ""; string OverSize = "";
  448. for (int i = 6; i < data.Columns.Count; i++)
  449. {
  450. if (Convert.ToInt32(data.Rows[0][i]) > 0)
  451. {
  452. Thin = "细系";
  453. }
  454. if (Convert.ToInt32(data.Rows[1][i]) > 0)
  455. {
  456. Thick = "粗系";
  457. }
  458. if (Convert.ToInt32(data.Rows[2][i]) > 0)
  459. {
  460. OverSize = "超尺寸";
  461. }
  462. }
  463. if (Thin != "" || Thick != "" || OverSize != "")
  464. {
  465. str_result = str + "的" + Thin + Thick + OverSize;
  466. return true;
  467. }
  468. return false;
  469. }
  470. #endregion
  471. #region 相关事件
  472. /// <summary>
  473. /// 复制选择区域,A
  474. /// </summary>
  475. public void CopySelected_A()
  476. {
  477. //复制选择区域
  478. object oo = Gview_gzA.GetClipboardContent();
  479. Clipboard.SetDataObject(Gview_gzA.GetClipboardContent());
  480. }
  481. /// <summary>
  482. /// 复制选择区域,B
  483. /// </summary>
  484. public void CopySelected_B()
  485. {
  486. //复制选择区域
  487. object oo = Gview_gzB.GetClipboardContent();
  488. Clipboard.SetDataObject(Gview_gzA.GetClipboardContent());
  489. }
  490. /// <summary>
  491. /// 复制选择区域,C
  492. /// </summary>
  493. public void CopySelected_C()
  494. {
  495. //复制选择区域
  496. object oo = Gview_gzC.GetClipboardContent();
  497. Clipboard.SetDataObject(Gview_gzA.GetClipboardContent());
  498. }
  499. /// <summary>
  500. /// 复制选择区域,D
  501. /// </summary>
  502. public void CopySelected_D()
  503. {
  504. //复制选择区域
  505. object oo = Gview_gzD.GetClipboardContent();
  506. Clipboard.SetDataObject(Gview_gzA.GetClipboardContent());
  507. }
  508. /// <summary>
  509. /// 复制选择区域,DS
  510. /// </summary>
  511. public void CopySelected_DS()
  512. {
  513. //复制选择区域
  514. object oo = Gview_gzDS.GetClipboardContent();
  515. Clipboard.SetDataObject(Gview_gzA.GetClipboardContent());
  516. }
  517. /// <summary>
  518. /// 复制所有,A
  519. /// </summary>
  520. public void CopyAll_A()
  521. {
  522. Gview_gzA.SelectAll();
  523. Clipboard.SetDataObject(Gview_gzA.GetClipboardContent());
  524. }
  525. /// <summary>
  526. /// 复制所有,B
  527. /// </summary>
  528. public void CopyAll_B()
  529. {
  530. Gview_gzB.SelectAll();
  531. Clipboard.SetDataObject(Gview_gzB.GetClipboardContent());
  532. }
  533. /// <summary>
  534. /// 复制所有,C
  535. /// </summary>
  536. public void CopyAll_C()
  537. {
  538. Gview_gzC.SelectAll();
  539. Clipboard.SetDataObject(Gview_gzC.GetClipboardContent());
  540. }
  541. /// <summary>
  542. /// 复制所有,D
  543. /// </summary>
  544. public void CopyAll_D()
  545. {
  546. Gview_gzD.SelectAll();
  547. Clipboard.SetDataObject(Gview_gzD.GetClipboardContent());
  548. }
  549. /// <summary>
  550. /// 复制所有,DS
  551. /// </summary>
  552. public void CopyAll_DS()
  553. {
  554. Gview_gzDS.SelectAll();
  555. Clipboard.SetDataObject(Gview_gzDS.GetClipboardContent());
  556. }
  557. private void Gview_gzA_SortCompare(object sender, DataGridViewSortCompareEventArgs e)
  558. {
  559. //排序中
  560. if (this.Gview_gzA.Rows[e.RowIndex1].Tag != null && this.Gview_gzA.Rows[e.RowIndex1].Tag.ToString() == "统计行")
  561. {
  562. //ROW1>ROW2
  563. e.SortResult = 1;
  564. if (this.Gview_gzA.SortOrder == SortOrder.Descending)
  565. e.SortResult = -1;
  566. e.Handled = true;
  567. return;
  568. }
  569. if (this.Gview_gzA.Rows[e.RowIndex2].Tag != null && this.Gview_gzA.Rows[e.RowIndex2].Tag.ToString() == "统计行")
  570. {
  571. //ROW1<ROW2
  572. e.SortResult = -1;
  573. if (this.Gview_gzA.SortOrder == SortOrder.Descending)
  574. e.SortResult = 1;
  575. e.Handled = true;
  576. return;
  577. }
  578. }
  579. private void Gview_gzA_Sorted(object sender, EventArgs e)
  580. {
  581. //排序完成,重新设置序号
  582. for (int i = 0; i < Gview_gzA.Rows.Count; i++)
  583. {
  584. if (Gview_gzA.Rows[i].Tag != null && this.Gview_gzA.Rows[i].Tag.ToString() == "统计行")
  585. { }
  586. else
  587. {
  588. Gview_gzA.Rows[i].Cells[0].Value = i.ToString();
  589. }
  590. }
  591. }
  592. private void Gview_gzB_SortCompare(object sender, DataGridViewSortCompareEventArgs e)
  593. {
  594. //排序中
  595. if (this.Gview_gzB.Rows[e.RowIndex1].Tag != null && this.Gview_gzB.Rows[e.RowIndex1].Tag.ToString() == "统计行")
  596. {
  597. //ROW1>ROW2
  598. e.SortResult = 1;
  599. if (this.Gview_gzB.SortOrder == SortOrder.Descending)
  600. e.SortResult = -1;
  601. e.Handled = true;
  602. return;
  603. }
  604. if (this.Gview_gzB.Rows[e.RowIndex2].Tag != null && this.Gview_gzB.Rows[e.RowIndex2].Tag.ToString() == "统计行")
  605. {
  606. //ROW1<ROW2
  607. e.SortResult = -1;
  608. if (this.Gview_gzB.SortOrder == SortOrder.Descending)
  609. e.SortResult = 1;
  610. e.Handled = true;
  611. return;
  612. }
  613. }
  614. private void Gview_gzB_Sorted(object sender, EventArgs e)
  615. {
  616. //排序完成,重新设置序号
  617. for (int i = 0; i < Gview_gzB.Rows.Count; i++)
  618. {
  619. if (Gview_gzB.Rows[i].Tag != null && this.Gview_gzB.Rows[i].Tag.ToString() == "统计行")
  620. { }
  621. else
  622. {
  623. Gview_gzB.Rows[i].Cells[0].Value = i.ToString();
  624. }
  625. }
  626. }
  627. private void Gview_gzC_SortCompare(object sender, DataGridViewSortCompareEventArgs e)
  628. {
  629. //排序中
  630. if (this.Gview_gzC.Rows[e.RowIndex1].Tag != null && this.Gview_gzC.Rows[e.RowIndex1].Tag.ToString() == "统计行")
  631. {
  632. //ROW1>ROW2
  633. e.SortResult = 1;
  634. if (this.Gview_gzC.SortOrder == SortOrder.Descending)
  635. e.SortResult = -1;
  636. e.Handled = true;
  637. return;
  638. }
  639. if (this.Gview_gzC.Rows[e.RowIndex2].Tag != null && this.Gview_gzC.Rows[e.RowIndex2].Tag.ToString() == "统计行")
  640. {
  641. //ROW1<ROW2
  642. e.SortResult = -1;
  643. if (this.Gview_gzC.SortOrder == SortOrder.Descending)
  644. e.SortResult = 1;
  645. e.Handled = true;
  646. return;
  647. }
  648. }
  649. private void Gview_gzC_Sorted(object sender, EventArgs e)
  650. {
  651. //排序完成,重新设置序号
  652. for (int i = 0; i < Gview_gzC.Rows.Count; i++)
  653. {
  654. if (Gview_gzC.Rows[i].Tag != null && this.Gview_gzC.Rows[i].Tag.ToString() == "统计行")
  655. { }
  656. else
  657. {
  658. Gview_gzC.Rows[i].Cells[0].Value = i.ToString();
  659. }
  660. }
  661. }
  662. private void Gview_gzD_SortCompare(object sender, DataGridViewSortCompareEventArgs e)
  663. {
  664. //排序中
  665. if (this.Gview_gzD.Rows[e.RowIndex1].Tag != null && this.Gview_gzD.Rows[e.RowIndex1].Tag.ToString() == "统计行")
  666. {
  667. //ROW1>ROW2
  668. e.SortResult = 1;
  669. if (this.Gview_gzD.SortOrder == SortOrder.Descending)
  670. e.SortResult = -1;
  671. e.Handled = true;
  672. return;
  673. }
  674. if (this.Gview_gzD.Rows[e.RowIndex2].Tag != null && this.Gview_gzD.Rows[e.RowIndex2].Tag.ToString() == "统计行")
  675. {
  676. //ROW1<ROW2
  677. e.SortResult = -1;
  678. if (this.Gview_gzD.SortOrder == SortOrder.Descending)
  679. e.SortResult = 1;
  680. e.Handled = true;
  681. return;
  682. }
  683. }
  684. private void Gview_gzD_Sorted(object sender, EventArgs e)
  685. {
  686. //排序完成,重新设置序号
  687. for (int i = 0; i < Gview_gzD.Rows.Count; i++)
  688. {
  689. if (Gview_gzD.Rows[i].Tag != null && this.Gview_gzD.Rows[i].Tag.ToString() == "统计行")
  690. { }
  691. else
  692. {
  693. Gview_gzD.Rows[i].Cells[0].Value = i.ToString();
  694. }
  695. }
  696. }
  697. private void Gview_gzDS_SortCompare(object sender, DataGridViewSortCompareEventArgs e)
  698. {
  699. //排序中
  700. if (this.Gview_gzDS.Rows[e.RowIndex1].Tag != null && this.Gview_gzDS.Rows[e.RowIndex1].Tag.ToString() == "统计行")
  701. {
  702. //ROW1>ROW2
  703. e.SortResult = 1;
  704. if (this.Gview_gzDS.SortOrder == SortOrder.Descending)
  705. e.SortResult = -1;
  706. e.Handled = true;
  707. return;
  708. }
  709. if (this.Gview_gzDS.Rows[e.RowIndex2].Tag != null && this.Gview_gzDS.Rows[e.RowIndex2].Tag.ToString() == "统计行")
  710. {
  711. //ROW1<ROW2
  712. e.SortResult = -1;
  713. if (this.Gview_gzDS.SortOrder == SortOrder.Descending)
  714. e.SortResult = 1;
  715. e.Handled = true;
  716. return;
  717. }
  718. }
  719. private void Gview_gzDS_Sorted(object sender, EventArgs e)
  720. {
  721. //排序完成,重新设置序号
  722. for (int i = 0; i < Gview_gzDS.Rows.Count; i++)
  723. {
  724. if (Gview_gzDS.Rows[i].Tag != null && this.Gview_gzDS.Rows[i].Tag.ToString() == "统计行")
  725. { }
  726. else
  727. {
  728. Gview_gzDS.Rows[i].Cells[0].Value = i.ToString();
  729. }
  730. }
  731. }
  732. private void ToolStripMenuItem1_Click(object sender, EventArgs e)
  733. {
  734. //A,复制整个表
  735. CopyAll_A();
  736. }
  737. private void ToolStripMenuItem2_Click(object sender, EventArgs e)
  738. {
  739. //A,复制选择区域
  740. CopySelected_A();
  741. }
  742. private void toolStripMenuItem4_Click(object sender, EventArgs e)
  743. {
  744. //B,复制整个表
  745. CopyAll_B();
  746. }
  747. private void toolStripMenuItem5_Click(object sender, EventArgs e)
  748. {
  749. //B,复制选择区域
  750. CopySelected_B();
  751. }
  752. private void toolStripMenuItem7_Click(object sender, EventArgs e)
  753. {
  754. //C,复制整个表
  755. CopyAll_C();
  756. }
  757. private void toolStripMenuItem8_Click(object sender, EventArgs e)
  758. {
  759. //C,复制选择区域
  760. CopySelected_C();
  761. }
  762. private void toolStripMenuItem10_Click(object sender, EventArgs e)
  763. {
  764. //D,复制整个表
  765. CopyAll_D();
  766. }
  767. private void toolStripMenuItem11_Click(object sender, EventArgs e)
  768. {
  769. //D,复制选择区域
  770. CopySelected_D();
  771. }
  772. private void toolStripMenuItem13_Click(object sender, EventArgs e)
  773. {
  774. //DS,复制整个表
  775. CopyAll_DS();
  776. }
  777. private void toolStripMenuItem14_Click(object sender, EventArgs e)
  778. {
  779. //DS,复制选择区域
  780. CopySelected_DS();
  781. }
  782. #endregion
  783. #region 获取向导出模块提供的DataTable和GridView对象
  784. /// <summary>
  785. /// 获取到该模块输出后形成的DataTable,和GridView
  786. /// </summary>
  787. /// <param name="out_dt"></param>
  788. /// <param name="out_dg"></param>
  789. public void GetDataTableAndGridView(out DataTable out_dtA, out DataTable out_dtB, out DataTable out_dtC, out DataTable out_dtD, out DataTable out_dt_sulfide, out DataTable out_dtDS,
  790. out DataGridView out_dgA, out DataGridView out_dgB, out DataGridView out_dgC, out DataGridView out_dgD, out DataGridView out_dgsulfide, out DataGridView out_dgDS)
  791. {
  792. //从panel中找出前5个datagridview,然后进行输出
  793. foreach (Control ctl in this.panel1.Controls)
  794. {
  795. if (ctl.Name == "0")
  796. {
  797. this.Gview_gzA = (DataGridView)ctl;
  798. }
  799. if (ctl.Name == "1")
  800. {
  801. this.Gview_gzB = (DataGridView)ctl;
  802. }
  803. if (ctl.Name == "2")
  804. {
  805. this.Gview_gzC = (DataGridView)ctl;
  806. }
  807. if (ctl.Name == "3")
  808. {
  809. this.Gview_gzD = (DataGridView)ctl;
  810. }
  811. if (ctl.Name == "4")
  812. {
  813. this.sulfide = (DataGridView)ctl;
  814. }
  815. if (ctl.Name == "5")
  816. {
  817. this.Gview_gzDS = (DataGridView)ctl;
  818. }
  819. }
  820. out_dtA = m_dt_A;
  821. out_dgA = this.Gview_gzA;
  822. out_dtB = m_dt_B;
  823. out_dgB = this.Gview_gzB;
  824. out_dtC = m_dt_C;
  825. out_dgC = this.Gview_gzC;
  826. out_dtD = m_dt_D;
  827. out_dgD = this.Gview_gzD;
  828. out_dt_sulfide = m_dt_sulfide;
  829. out_dgsulfide = this.sulfide;
  830. out_dtDS = m_dt_DS;
  831. out_dgDS = this.Gview_gzDS;
  832. }
  833. #endregion
  834. #region clr加载数据部分
  835. public DataTable ChineseStandardABCD_GetDataTable_Total(List<CGridDataClr> in_list_cgriddataclr, out int oneresult_columncount)
  836. {
  837. oneresult_columncount = 1;//一个数据源的跨度,计算出一个数据源包含几个列
  838. //创建一个临时表
  839. DataTable ret_dt = new DataTable();
  840. //判断传入的数据对象是否为空
  841. if (in_list_cgriddataclr == null)
  842. {
  843. string str1 = "传入分解表格数据的CGridDataClr对象为空!";
  844. str1 = table["str1"].ToString();
  845. //log.Error("(OTSIncAReportGridsFun.ChineseStandardABCD_GetDataTable_Total)" + str1);
  846. return ret_dt;
  847. }
  848. #region 根据返回的结构创建DataTable的结构---------------------------------------------
  849. for (int i = 0; i < in_list_cgriddataclr.Count(); i++)
  850. {
  851. //分解结果内容
  852. List<CGridColumnClr> list_cgridcolumnclrs = new List<CGridColumnClr>();
  853. list_cgridcolumnclrs = in_list_cgriddataclr[i].GetGridColumnList(); //获取各列
  854. //单个数据源包含几个列的跨度
  855. if (oneresult_columncount < list_cgridcolumnclrs.Count())
  856. oneresult_columncount = list_cgridcolumnclrs.Count();
  857. if (in_list_cgriddataclr.Count > 1)
  858. {
  859. //创建DT的列,多个数据源,为每个字段带上索引号
  860. foreach (CGridColumnClr ls_cgridcolumnclr in list_cgridcolumnclrs)
  861. {
  862. string ls_fl_strName = ls_cgridcolumnclr.GetName();
  863. //通过获取到的列,创建表的列
  864. ret_dt.Columns.Add(ls_fl_strName + "(" + (i + 1).ToString() + ")");
  865. }
  866. }
  867. else
  868. {
  869. //创建DT的列,单个数据源,不带索引号
  870. foreach (CGridColumnClr ls_cgridcolumnclr in list_cgridcolumnclrs)
  871. {
  872. string ls_fl_strName = ls_cgridcolumnclr.GetName();
  873. //通过获取到的列,创建表的列
  874. ret_dt.Columns.Add(ls_fl_strName);
  875. }
  876. }
  877. }
  878. #endregion
  879. #region 再创建表的行------------------------------------------------------------------
  880. //取最大的rowlistcount,要不然,不知道这底层返回的数据居然还有2,2,3这样的行数据
  881. int maxrownumber = 0;
  882. for (int i = 0; i < in_list_cgriddataclr.Count(); i++)
  883. {
  884. //分解结果内容
  885. List<CGridColumnClr> list_cgridcolumnclrs = new List<CGridColumnClr>();
  886. list_cgridcolumnclrs = in_list_cgriddataclr[i].GetGridColumnList(); //获取各列
  887. //创建DT的行
  888. if (list_cgridcolumnclrs != null)
  889. {
  890. foreach (CGridColumnClr ls_cgridcolumnclr in list_cgridcolumnclrs)
  891. {
  892. if (maxrownumber < ls_cgridcolumnclr.GetRowList().Count())
  893. {
  894. maxrownumber = ls_cgridcolumnclr.GetRowList().Count();
  895. }
  896. }
  897. }
  898. }
  899. for (int k = 0; k < maxrownumber; k++)
  900. {
  901. DataRow dr = ret_dt.NewRow();
  902. ret_dt.Rows.Add(dr);
  903. }
  904. #endregion
  905. #region //再次重新分解,先分解列,然后将获取到的各行各列的数据,填充到相应的位置上---
  906. for (int i = 0; i < in_list_cgriddataclr.Count(); i++)
  907. {
  908. //分解结果内容
  909. List<CGridColumnClr> list_cgridcolumnclrs = new List<CGridColumnClr>();
  910. list_cgridcolumnclrs = in_list_cgriddataclr[i].GetGridColumnList(); //获取各列
  911. //再次重新分解,先分解列,然后将获取到的
  912. for (int k = 0; k < list_cgridcolumnclrs.Count(); k++)
  913. {
  914. string ls_fl_strName = list_cgridcolumnclrs[k].GetName();
  915. List<CGridRowClr> ls_list_cgridrowclr = new List<CGridRowClr>();
  916. ls_list_cgridrowclr = list_cgridcolumnclrs[k].GetRowList();
  917. for (int j = 0; j < ls_list_cgridrowclr.Count(); j++)
  918. {
  919. //先判断该行该单元格的数据类型
  920. string str_value = "";//因为显示只需要对字符串进行操作就可以了,所以将底层获取到的数据,除了颗粒类型外的都转成string
  921. switch (ls_list_cgridrowclr[j].GetDataType())
  922. {
  923. case 0:
  924. //string
  925. str_value = ls_list_cgridrowclr[j].GetStringValue();
  926. ret_dt.Rows[j][k + i * oneresult_columncount] = str_value;
  927. break;
  928. case 1:
  929. //该元素含量表没有需要显示的颗粒图像
  930. //ret_dt.Rows[j][k+i*oneresult_columncount] = GetBitmapByParticleList(ls_list_cgridrowclr[k].GetParticle());
  931. break;
  932. case 2:
  933. //int
  934. str_value = ls_list_cgridrowclr[j].GetIntValue().ToString();
  935. ret_dt.Rows[j][k + i * oneresult_columncount] = str_value;
  936. break;
  937. case 3:
  938. //float
  939. str_value = ls_list_cgridrowclr[j].GetDoubleValue().ToString("0.00");
  940. ret_dt.Rows[j][k + i * oneresult_columncount] = str_value;
  941. break;
  942. default:
  943. str_value = "";
  944. ret_dt.Rows[j][k + i * oneresult_columncount] = str_value;
  945. break;
  946. }
  947. }
  948. }
  949. }
  950. #endregion
  951. return ret_dt;
  952. }
  953. #endregion
  954. #region 读取加载clr中的国标数据信息
  955. public List<DataTable> ChineseStandardABCD_GetDataTable()
  956. {
  957. List<DataTable> dataTables = new List<DataTable>();
  958. dataTables.Add(ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_A, out m_oneresult_columnscount_A));
  959. dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_B, out m_oneresult_columnscount_B));
  960. dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_C, out m_oneresult_columnscount_C));
  961. dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_D, out m_oneresult_columnscount_D));
  962. dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_sulfide, out m_oneresult_columnscount_sulfide));
  963. dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_DS, out m_oneresult_columnscount_DS));
  964. return dataTables;
  965. }
  966. #endregion
  967. private void button_preview_Click(object sender, EventArgs e)
  968. {
  969. frmReportApp frmReportApp = (frmReportApp)this.ParentForm.ParentForm;
  970. OTSReport_Export oe = new OTSReport_Export(frmReportApp, true);
  971. GBReport GB_Report = new GBReport(frmReportApp, table);
  972. int index = frmReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
  973. List<string> datasourcelist = oe.m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
  974. OTSCLRINTERFACE.CPropParamClr clr_prop = oe.m_ReportApp.m_rstDataMgr.m_ReportMgr.GetPropertyParamTable();
  975. clr_prop.SetDataSourceList(datasourcelist);
  976. clr_prop.SetDataSourceId(index);//
  977. clr_prop.SetCalTableType((int)CALCULATE_TABLE_TYPE.GB_Method1);
  978. clr_prop.SetType((int)DisplayPicutureType.AnalyzeDataTable);//table
  979. frmReportApp.m_rstDataMgr.SetWorkingResultId(index);
  980. var tbl = oe.m_ReportApp.m_rstDataMgr.m_ReportMgr.GetAllGBFields(clr_prop);
  981. GB_Report.setResultGrid(oe.m_mbszclass, tbl, datasourcelist[index]);
  982. oe.Dispose();
  983. oe = null;
  984. DataView dv_gb1 = m_dt_dall[5].DefaultView;
  985. dv_gb1.Sort = "Grade desc";
  986. DataTable dt_gb1 = dv_gb1.ToTable();
  987. for (int i = 0; i < m_dt_dall[5].Rows.Count; i++)
  988. {
  989. for (int a = 0; a < m_dt_dall[5].Columns.Count; a++)
  990. {
  991. m_dt_dall[5].Rows[i][a] = dt_gb1.Rows[i][a];
  992. }
  993. }
  994. List<string> GB2NameList = new List<string>();
  995. GB2NameList.Add("A类");
  996. GB2NameList.Add("B类");
  997. GB2NameList.Add("C类");
  998. GB2NameList.Add("D类");
  999. GB2NameList.Add("D硫化物类");
  1000. GB2NameList.Add("DS类");
  1001. GB_Report.set_GB_Method(m_dt_dall, GB2NameList, "方法二");
  1002. DevExpress.XtraReports.UI.ReportPrintTool tool = new DevExpress.XtraReports.UI.ReportPrintTool(GB_Report);
  1003. tool.ShowPreview();
  1004. }
  1005. }
  1006. }