rptAlarmLog.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using DataDynamics.ActiveReports;
  7. using DataDynamics.ActiveReports.Document;
  8. namespace FPER
  9. {
  10. /// <summary>
  11. /// Summary description for rptAlarmLog.
  12. /// </summary>
  13. public partial class rptAlarmLog : DataDynamics.ActiveReports.ActiveReport
  14. {
  15. private int index;
  16. private ArrayList details;
  17. private int tleReceiverId = 0;
  18. private string tleFromToDate = "";
  19. private string tleAlarmType = "전체";
  20. private string tleAlarmLocation = "전체";
  21. public int ReceiverId { set { this.tleReceiverId = value; } }
  22. public string FromToDate { set { this.tleFromToDate = value; } }
  23. public string AlarmType { set { this.tleAlarmType = value; } }
  24. public string AlarmLocation { set { this.tleAlarmLocation = value; } }
  25. public ArrayList Details { set { this.details = value; } }
  26. public rptAlarmLog()
  27. {
  28. //
  29. // Required for Windows Form Designer support
  30. //
  31. InitializeComponent();
  32. }
  33. /// <summary>
  34. /// DataInitialize Event
  35. /// ActiveReports event that is called during the report initalization
  36. /// procedure. (after .Run is called on your report object) Normally used
  37. /// with unbound reporting to establish an active connection to your data
  38. /// to be used with the FetchData event, or to setup a bound report with a
  39. /// dynamic database connection at runtime.
  40. /// This is also where you should include any Fields values that you need to
  41. /// add for unbound reporting.
  42. /// </summary>
  43. private void rptAlarmLog_DataInitialize(object sender, System.EventArgs eArgs)
  44. {
  45. try
  46. {
  47. txtTleReceiverId.Text = this.tleReceiverId.ToString();
  48. txtTleFromToDate.Text = this.tleFromToDate;
  49. txtTleAlarmType.Text = this.tleAlarmType;
  50. txtTleAlarmLocation.Text = this.tleAlarmLocation;
  51. this.Fields.Add("No");
  52. this.Fields.Add("AlarmDate");
  53. this.Fields.Add("AlarmType");
  54. this.Fields.Add("AlarmLocation");
  55. this.Fields.Add("ConfirmYes");
  56. this.Fields.Add("ConfirmDate");
  57. // Init some test data:
  58. //this.details = new ArrayList();
  59. //this.details.Add(new ReportDetail("A", 10.00, 2));
  60. //this.details.Add(new ReportDetail("B", 0.12, 1));
  61. //this.details.Add(new ReportDetail("C", 5.92, 3));
  62. this.index = -1;
  63. }
  64. catch (Exception ex)
  65. {
  66. Util.UErrorMessage(ex, 0, 0);
  67. }
  68. }
  69. /// <summary>
  70. /// FetchData Event
  71. /// ActiveReports event that is called during the report run once per
  72. /// row from the dataset. This event is usually only used in unbound reporting,
  73. /// you would set the Fields collection value to the value from your dataset and
  74. /// advance the next row. When you run out of data, you should set the
  75. /// FetchEventArgs argument's EOF field to true to tell the report that the report
  76. /// is done with the data.
  77. /// </summary>
  78. private void rptAlarmLog_FetchData(object sender, DataDynamics.ActiveReports.ActiveReport.FetchEventArgs eArgs)
  79. {
  80. try
  81. {
  82. if (this.index >= this.details.Count - 1)
  83. {
  84. eArgs.EOF = true;
  85. return;
  86. }
  87. else
  88. {
  89. eArgs.EOF = false;
  90. }
  91. AlarmLogDetail row = (AlarmLogDetail)this.details[++this.index];
  92. this.Fields["No"].Value = row.no;
  93. this.Fields["AlarmDate"].Value = row.alarmDate;
  94. this.Fields["AlarmType"].Value = row.alarmType;
  95. this.Fields["AlarmLocation"].Value = row.alarmLocation;
  96. this.Fields["ConfirmYes"].Value = row.confirmYes;
  97. this.Fields["ConfirmDate"].Value = row.confirmDate;
  98. }
  99. catch (Exception ex)
  100. {
  101. Util.UErrorMessage(ex, 0, 0);
  102. }
  103. }
  104. }
  105. public class AlarmLogDetail
  106. {
  107. public int no;
  108. public string alarmDate;
  109. public string alarmType;
  110. public string alarmLocation;
  111. public string confirmYes;
  112. public string confirmDate;
  113. public AlarmLogDetail(int no, string alarmDate, string alarmType, string alarmLocation, string confirmYes, string confirmDate)
  114. {
  115. try
  116. {
  117. this.no = no;
  118. this.alarmDate = alarmDate;
  119. this.alarmType = alarmType;
  120. this.alarmLocation = alarmLocation;
  121. this.confirmYes = confirmYes;
  122. this.confirmDate = confirmDate;
  123. }
  124. catch (Exception ex)
  125. {
  126. Util.UErrorMessage(ex, 0, 0);
  127. }
  128. }
  129. public AlarmLogDetail(int no, string alarmDate, string alarmType, string alarmLocation)
  130. {
  131. try
  132. {
  133. this.no = no;
  134. this.alarmDate = alarmDate;
  135. this.alarmType = alarmType;
  136. this.alarmLocation = alarmLocation;
  137. }
  138. catch (Exception ex)
  139. {
  140. Util.UErrorMessage(ex, 0, 0);
  141. }
  142. }
  143. }
  144. }