Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.64 KB | None | 0 0
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EquipmentTimesheetRDLC.aspx.cs" Inherits="CamstarReportPortal.Equipment.EquipmentTimesheetRDLC" MasterPageFile="~/Common/SiteMaster.Master" %>
  2. <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
  3. <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
  4.  
  5. <asp:Content ID="Content1" ContentPlaceHolderID="cphContent" runat="server">
  6. <div title="Enter an Equipment ID to begin search.">
  7. <h1>
  8. <asp:Label ID="lblTitle" runat="server" Font-Underline="True" Font-Bold="true" Text="Equipment Timesheet"></asp:Label>
  9. </h1>
  10. </div>
  11. <div>
  12. <table>
  13. <tr>
  14. <td>
  15. <table>
  16. <tr>
  17. <td>
  18. <fieldset class="field_set">
  19. <legend style="color: #000000;"><a class="label">Required Filters</a></legend>
  20. <table style="height: 75px">
  21. <tr>
  22. <td class="label">
  23. Division:
  24. </td>
  25. <td>
  26. <asp:DropDownList ID="ddlDivision" CssClass="txtBox" runat="server" AutoPostBack="True" Width="150px"
  27. DataSourceID="sqldsDivision" DataTextField="DIVISION_TEXT" DataValueField="DIVISION_TEXT">
  28. </asp:DropDownList>
  29. </td>
  30. <td class="label">
  31. Date From:
  32. </td>
  33. <td style="width: 158px">
  34. <asp:CalendarExtender ID="CalendarExtender1" runat="server" PopupButtonID="Image1" TargetControlID="txtDateFrom">
  35. </asp:CalendarExtender>
  36. <asp:TextBox ID="txtDateFrom" Width="125px" CssClass="txtBox" runat="server"></asp:TextBox>
  37. <asp:ImageButton runat="Server" ID="Image1" ImageUrl="~/ig_res/Trendy/images/imgDatePicker.png"
  38. AlternateText="Click to show calendar" />
  39. </td>
  40. <td class="label">
  41. Handler Type:
  42. </td>
  43. <td>
  44. <asp:DropDownList ID="ddlHandler" CssClass="txtBox" runat="server" AutoPostBack="True" Width="150px"
  45. DataSourceID="sqldsHType" DataTextField="HANDLERTYPE"
  46. DataValueField="HANDLERVALUE">
  47. </asp:DropDownList>
  48. </td>
  49. </tr>
  50. <tr>
  51. <td class="label">
  52. Tester Type:
  53. </td>
  54. <td>
  55. <asp:DropDownList ID="ddlTesterType" CssClass="txtBox" runat="server"
  56. DataSourceID="sqldsTesterType" Width="150px"
  57. DataTextField="TESTERTYPE" DataValueField="TESTERVALUE"
  58. AutoPostBack="True">
  59. </asp:DropDownList>
  60. </td>
  61. <td class="label">
  62. Date To:
  63. </td>
  64. <td>
  65. <asp:CalendarExtender ID="CalendarExtender2" runat="server" PopupButtonID="Image2" TargetControlID="txtDateTo">
  66. </asp:CalendarExtender>
  67. <asp:TextBox ID="txtDateTo" Width="125px" CssClass="txtBox" runat="server"></asp:TextBox>
  68. <asp:ImageButton runat="Server" ID="Image2" ImageUrl="~/ig_res/Trendy/images/imgDatePicker.png"
  69. AlternateText="Click to show calendar" />
  70. </td>
  71. <td class="label">
  72. Handler ID:
  73. </td>
  74. <td>
  75. <asp:DropDownList ID="ddlHandlerID" CssClass="txtBox" runat="server" Width="150px"
  76. DataSourceID="sqldsHandlerID" DataTextField="HANDLERID_TEXT"
  77. DataValueField="HANDLERID_VALUE">
  78. </asp:DropDownList>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td class="label">
  83. Tester ID:
  84. </td>
  85. <td>
  86. <asp:DropDownList ID="ddlTesterID" CssClass="txtBox" runat="server" DataSourceID="sqldsTesterID" Width="150px"
  87. DataTextField="TESTERID_TEXT" DataValueField="TESTERID_VALUE">
  88. </asp:DropDownList>
  89. <asp:TextBox ID="txtTesterID" CssClass="txtBox" runat="server" Visible="false"></asp:TextBox>
  90. </td>
  91. <td class="label">
  92. Shift:
  93. </td>
  94. <td>
  95. <asp:DropDownList ID="ddlShift" CssClass="txtBox" runat="server" Width="150px">
  96. <asp:ListItem Text="ALL" Value="%" Selected="True"></asp:ListItem>
  97. <asp:ListItem Text="A" Value="A"></asp:ListItem>
  98. <asp:ListItem Text="B" Value="B"></asp:ListItem>
  99. </asp:DropDownList>
  100. </td>
  101. </tr>
  102. </table>
  103. </fieldset>
  104. </td>
  105. <td>
  106. <fieldset class="field_set">
  107. <legend style="color: #000000"><a class="label">Optional Filters</a></legend>
  108. <table style="height: 75px">
  109. <tr>
  110. <td class="label">
  111. Lot Number:
  112. </td>
  113. <td>
  114. <asp:TextBox ID="txtBoxLot" runat="server" CssClass="txtBox"></asp:TextBox>
  115. </td>
  116. <td class="label">
  117. Operator ID:
  118. </td>
  119. <td>
  120. <asp:TextBox ID="txtBoxOperatorID" runat="server" CssClass="txtBox"></asp:TextBox>
  121. </td>
  122. </tr>
  123. <tr>
  124. <td class="label">
  125. Technician ID:
  126. </td>
  127. <td>
  128. <asp:TextBox ID="txtBoxTechID" runat="server" CssClass="txtBox"></asp:TextBox>
  129. </td>
  130. <td class="label">
  131. DieType:
  132. </td>
  133. <td>
  134. <asp:TextBox ID="txtBoxDieType" runat="server" CssClass="txtBox"></asp:TextBox>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td class="label">
  139. Status Code:
  140. </td>
  141. <td>
  142. <asp:TextBox ID="txtBoxStatusCode" runat="server" CssClass="txtBox"></asp:TextBox>
  143. </td>
  144. <td class="label">
  145. Device:
  146. </td>
  147. <td>
  148. <asp:TextBox ID="txtBoxDevice" runat="server" CssClass="txtBox"></asp:TextBox>
  149. </td>
  150. </tr>
  151. </table>
  152. </fieldset>
  153. </td>
  154. <td>
  155. <asp:Button ID="btnFilter" runat="server" Text="Search" CssClass="text"
  156. Width="50px" onclick="btnFilter_Click" /><br />
  157. <br />
  158. <asp:Button ID="btnReset" runat="server" Text="Reset" CssClass="text" Width="50px"/><br />
  159. </td>
  160. </tr>
  161. <tr>
  162. <td>
  163. </td>
  164. <td colspan="1" align="right">
  165. </td>
  166. </tr>
  167. </table>
  168. </td>
  169. </tr>
  170. </table>
  171. </div>
  172. <div>
  173. <rsweb:ReportViewer ID="reportViewer" Font-Names="Verdana" AsyncRendering="false" SizeToReportContent="True"
  174. Font-Size="8pt" runat="server">
  175. <LocalReport>
  176. <DataSources>
  177. <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="EquipmentTimesheet_SP_GETEQUIPMENTTIMESHEET" />
  178. </DataSources>
  179. </LocalReport>
  180. </rsweb:ReportViewer>
  181. </div>
  182. <div>
  183. <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
  184. OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
  185. TypeName="CamstarReportPortal.Equipment.Reports.EquipmentTimesheetTableAdapters.SP_GETEQUIPMENTTIMESHEETTableAdapter">
  186. <SelectParameters>
  187. <asp:ControlParameter ControlID="txtDateFrom" Name="fromdate"
  188. PropertyName="Text" Type="String" />
  189. <asp:ControlParameter ControlID="txtDateTo" Name="todate" PropertyName="Text"
  190. Type="String" />
  191. <asp:ControlParameter ControlID="ddlDivision" Name="location"
  192. PropertyName="SelectedValue" Type="String" />
  193. <asp:ControlParameter ControlID="ddlTesterID" Name="equipment"
  194. PropertyName="SelectedValue" Type="String" />
  195. <asp:ControlParameter ControlID="ddlTesterType" Name="testertype"
  196. PropertyName="SelectedValue" Type="String" />
  197. <asp:ControlParameter ControlID="txtBoxLot" Name="lotID" PropertyName="Text"
  198. Type="String" />
  199. <asp:ControlParameter ControlID="ddlHandler" Name="handlertype"
  200. PropertyName="SelectedValue" Type="String" />
  201. <asp:ControlParameter ControlID="ddlHandlerID" Name="handlerid"
  202. PropertyName="SelectedValue" Type="String" />
  203. <asp:ControlParameter ControlID="txtBoxOperatorID" Name="operatorid"
  204. PropertyName="Text" Type="String" />
  205. <asp:ControlParameter ControlID="txtBoxStatusCode" Name="statuscode"
  206. PropertyName="Text" Type="String" />
  207. <asp:ControlParameter ControlID="txtBoxTechID" Name="techid"
  208. PropertyName="Text" Type="String" />
  209. <asp:ControlParameter ControlID="txtBoxDevice" Name="device"
  210. PropertyName="Text" Type="String" />
  211. <asp:ControlParameter ControlID="txtBoxDieType" Name="dietype"
  212. PropertyName="Text" Type="String" />
  213. <asp:ControlParameter ControlID="ddlShift" Name="shift"
  214. PropertyName="SelectedValue" Type="String" />
  215. <asp:Parameter Direction="Output" Name="pCursor" Type="Object" />
  216. </SelectParameters>
  217. </asp:ObjectDataSource>
  218. </div>
  219. <div>
  220. <asp:SqlDataSource ID="sqldsDivision" runat="server" ConnectionString="<%$ ConnectionStrings:Camstar %>"
  221. ProviderName="<%$ ConnectionStrings:Camstar.ProviderName %>" SelectCommand="SELECT DECODE(mxstatusreasoncategoryname,'WAFERSORT','WS','FINALTEST','FT','TAPENREEL','TR',mxstatusreasoncategoryname) DIVISION_TEXT
  222. FROM a_mxstatusreasoncategory
  223. ORDER BY DIVISION_TEXT"></asp:SqlDataSource>
  224. <asp:SqlDataSource ID="sqldsTesterType" runat="server" ConnectionString="<%$ ConnectionStrings:Camstar %>"
  225. ProviderName="<%$ ConnectionStrings:Camstar.ProviderName %>" SelectCommand="SELECT 'ALL' TESTERTYPE
  226. ,'%' TESTERVALUE
  227. FROM DUAL
  228. UNION ALL
  229. SELECT *
  230. FROM
  231. (
  232. SELECT DISTINCT r.vendormodel TESTERTYPE
  233. ,r.vendormodel TESTERVALUE
  234. FROM resourcedef r
  235. JOIN a_mxstatusreasoncategory src ON r.mxstatusreasoncategoryid = src.mxstatusreasoncategoryid
  236. WHERE r.vendormodel IS NOT NULL
  237. AND DECODE(src.mxstatusreasoncategoryname,'WAFERSORT','WS','FINALTEST','FT','TAPENREEL','TR','NONATE','NONATE') = :division
  238. AND r.attr_02 IN ('TESTER','NON-ATE')
  239. ORDER BY TESTERTYPE
  240. )">
  241.  
  242.  
  243. <SelectParameters>
  244. <asp:ControlParameter ControlID="ddlDivision" Name="division" PropertyName="SelectedValue" />
  245. </SelectParameters>
  246. </asp:SqlDataSource>
  247. <asp:SqlDataSource ID="sqldsTesterID" runat="server" ConnectionString="<%$ ConnectionStrings:Camstar %>"
  248. ProviderName="<%$ ConnectionStrings:Camstar.ProviderName %>" SelectCommand="SELECT 'ALL' AS TESTERID_TEXT
  249. ,'%' AS TESTERID_VALUE
  250. FROM DUAL
  251. UNION ALL
  252. SELECT r.resourcename TESTERID_TEXT
  253. ,r.resourcename TESTERID_VALUE
  254. FROM resourcedef r
  255. JOIN a_mxstatusreasoncategory src ON r.mxstatusreasoncategoryid = src.mxstatusreasoncategoryid
  256. WHERE r.attr_06 = 'ACTIVE' AND r.vendormodel = :testerType AND r.resourcename NOT LIKE 'DUMMY%'
  257. AND DECODE(src.mxstatusreasoncategoryname,'WAFERSORT','WS','FINALTEST','FT','TAPENREEL','TR','NONATE','NONATE') = :division
  258. ORDER BY TESTERID_TEXT">
  259. <SelectParameters>
  260. <asp:ControlParameter ControlID="ddlTesterType" Name="testerType" PropertyName="SelectedValue" />
  261. <asp:ControlParameter ControlID="ddlDivision" Name="division" PropertyName="SelectedValue" />
  262. </SelectParameters>
  263. </asp:SqlDataSource>
  264. <asp:SqlDataSource ID="sqldsHType" runat="server"
  265. ConnectionString="<%$ ConnectionStrings:Camstar %>"
  266. ProviderName="<%$ ConnectionStrings:Camstar.ProviderName %>" SelectCommand="SELECT 'ALL' HANDLERTYPE
  267. ,'%' HANDLERVALUE
  268. FROM DUAL
  269. UNION ALL
  270. SELECT *
  271. FROM
  272. (
  273. SELECT DISTINCT r.vendormodel HANDLERTYPE
  274. ,r.vendormodel HANDLERVALUE
  275. FROM resourcedef r
  276. JOIN a_mxstatusreasoncategory src ON r.mxstatusreasoncategoryid = src.mxstatusreasoncategoryid
  277. WHERE r.vendormodel IS NOT NULL
  278. AND DECODE(src.mxstatusreasoncategoryname,'WAFERSORT','WS','FINALTEST','FT','TAPENREEL','TR','NONATE','NONATE') = :division
  279. AND r.attr_02 IN ('PROBER','HANDLER')
  280. ORDER BY HANDLERTYPE
  281. )">
  282. <SelectParameters>
  283. <asp:ControlParameter ControlID="ddlDivision" Name="division" PropertyName="SelectedValue" />
  284. </SelectParameters>
  285. </asp:SqlDataSource>
  286. <asp:SqlDataSource ID="sqldsHandlerID" runat="server"
  287. ConnectionString="<%$ ConnectionStrings:Camstar %>"
  288. ProviderName="<%$ ConnectionStrings:Camstar.ProviderName %>" SelectCommand="SELECT 'ALL' AS HANDLERID_TEXT
  289. ,'%' AS HANDLERID_VALUE
  290. FROM DUAL
  291. UNION ALL
  292. SELECT r.resourcename HANDLERID_TEXT
  293. ,r.resourcename HANDLERID_VALUE
  294. FROM resourcedef r
  295. JOIN a_mxstatusreasoncategory src ON r.mxstatusreasoncategoryid = src.mxstatusreasoncategoryid
  296. WHERE r.vendormodel = :handlerType AND r.resourcename NOT LIKE 'DUMMY%'
  297. AND DECODE(src.mxstatusreasoncategoryname,'WAFERSORT','WS','FINALTEST','FT','TAPENREEL','TR','NONATE','NONATE') = :division
  298. ORDER BY HANDLERID_TEXT">
  299. <SelectParameters>
  300. <asp:ControlParameter ControlID="ddlHandler" Name="handlerType"
  301. PropertyName="SelectedValue" />
  302. <asp:ControlParameter ControlID="ddlDivision" Name="division"
  303. PropertyName="SelectedValue" />
  304. </SelectParameters>
  305. </asp:SqlDataSource>
  306. </div>
  307. </asp:Content>
  308.  
  309. protected void btnFilter_Click(object sender, EventArgs e)
  310. {
  311. try
  312. {
  313. reportViewer.Visible = true;
  314.  
  315. reportViewer.LocalReport.ReportPath = Server.MapPath("~/Equipment/Reports/EquipmentTimesheet.rdlc");
  316. var reportParameterCollection = new ReportParameter[14];
  317.  
  318. reportParameterCollection[0] = new ReportParameter { Name = "fromdate" };
  319. reportParameterCollection[0].Values.Add(txtDateFrom.Text);
  320. reportParameterCollection[0].Visible = true;
  321.  
  322. reportParameterCollection[1] = new ReportParameter { Name = "todate" };
  323. reportParameterCollection[1].Values.Add(txtDateTo.Text);
  324. reportParameterCollection[1].Visible = true;
  325.  
  326. reportParameterCollection[2] = new ReportParameter { Name = "location" };
  327. reportParameterCollection[2].Values.Add(ddlDivision.Text);
  328. reportParameterCollection[2].Visible = true;
  329.  
  330. reportParameterCollection[3] = new ReportParameter { Name = "equipment" };
  331. reportParameterCollection[3].Values.Add(ddlTesterID.Text);
  332. reportParameterCollection[3].Visible = true;
  333.  
  334. reportParameterCollection[4] = new ReportParameter { Name = "testertype" };
  335. reportParameterCollection[4].Values.Add(ddlTesterType.Text);
  336. reportParameterCollection[4].Visible = true;
  337.  
  338. reportParameterCollection[5] = new ReportParameter { Name = "lotID" };
  339. reportParameterCollection[5].Values.Add(txtBoxLot.Text);
  340. reportParameterCollection[5].Visible = true;
  341.  
  342. reportParameterCollection[6] = new ReportParameter { Name = "handlertype" };
  343. reportParameterCollection[6].Values.Add(ddlHandler.Text);
  344. reportParameterCollection[6].Visible = true;
  345.  
  346. reportParameterCollection[7] = new ReportParameter { Name = "handlerid" };
  347. reportParameterCollection[7].Values.Add(ddlHandlerID.Text);
  348. reportParameterCollection[7].Visible = true;
  349.  
  350. reportParameterCollection[8] = new ReportParameter { Name = "operatorid" };
  351. reportParameterCollection[8].Values.Add(txtBoxOperatorID.Text);
  352. reportParameterCollection[8].Visible = true;
  353.  
  354. reportParameterCollection[9] = new ReportParameter { Name = "statuscode" };
  355. reportParameterCollection[9].Values.Add(txtBoxStatusCode.Text);
  356. reportParameterCollection[9].Visible = true;
  357.  
  358. reportParameterCollection[10] = new ReportParameter { Name = "techid" };
  359. reportParameterCollection[10].Values.Add(txtBoxTechID.Text);
  360. reportParameterCollection[10].Visible = true;
  361.  
  362. reportParameterCollection[11] = new ReportParameter { Name = "device" };
  363. reportParameterCollection[11].Values.Add(txtBoxDevice.Text);
  364. reportParameterCollection[11].Visible = true;
  365.  
  366. reportParameterCollection[12] = new ReportParameter { Name = "dietype" };
  367. reportParameterCollection[12].Values.Add(txtBoxDieType.Text);
  368. reportParameterCollection[12].Visible = true;
  369.  
  370. reportParameterCollection[13] = new ReportParameter { Name = "shift" };
  371. reportParameterCollection[13].Values.Add(ddlShift.Text);
  372. reportParameterCollection[13].Visible = true;
  373.  
  374. reportViewer.LocalReport.SetParameters(reportParameterCollection);
  375. reportViewer.LocalReport.Refresh();
  376. }
  377. catch (Exception ex)
  378. {
  379. X.MessageBox.Alert("Warning", ex.ToString()).Show();
  380. }
  381.  
  382.  
  383. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement