PageRenderTime 70ms CodeModel.GetById 60ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/Reports/CheqRcpt.aspx.cs

http://github.com/khaneh/Orders
C# | 89 lines | 66 code | 13 blank | 10 comment | 2 complexity | ead0a4b9ccbf84f8e5991bb0e8ea7b08 MD5 | raw file
 1using System;
 2using System.Collections;
 3using System.ComponentModel;
 4using System.Data;
 5using System.Drawing;
 6using System.Web;
 7using System.Web.SessionState;
 8using System.Web.UI;
 9using System.Web.UI.WebControls;
10using System.Web.UI.HtmlControls;
11using CrystalDecisions.CrystalReports.Engine;
12using CrystalDecisions.Shared;
13using CrystalDecisions.Web;
14
15namespace Reports
16{
17	/// <summary>
18	/// Summary description for WebForm1.
19	/// </summary>
20	public class CheqRcptWebForm : System.Web.UI.Page
21	{
22		protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;
23		protected System.Web.UI.WebControls.Button Button1;
24		protected System.Web.UI.HtmlControls.HtmlForm Form1;
25		protected ReportManager rm = new ReportManager();
26		CheqRcpt crReport = new CheqRcpt();
27		string paramName= "cheqID";
28		string param;
29	
30		private void Page_Load(object sender, System.EventArgs e)
31		{
32			param = Request.QueryString.Get(paramName);
33			
34			Boolean x = rm.initReport(crReport, CrystalReportViewer1, param, paramName);
35			if(!x) 
36			{
37				Response.Write ("error: Parameter Needed");
38				Response.End();
39			}
40		}
41
42
43		private void Button1_Click(object sender, System.EventArgs e)
44		{
45
46			rm.SetPrinter(Request.UserHostAddress);
47			Boolean x = rm.printReport(crReport, CrystalReportViewer1, param, paramName);
48			if(x) 
49			{
50				Response.Write("<br><br><br><br><br><br><br><br><br><br><br><br><br><font face=titr color=red size=5><center>");
51				Response.Write("���� ������ �� �� �� �ǁ��  <br>");
52				Response.Write(" ���� ����"+crReport.PrintOptions.PrinterName);
53				Response.Write("</center></font>");
54			}
55			else
56			{
57				Response.Write ("error: Problem in printing report");
58				Response.End();
59			}
60
61		
62		}
63		
64
65		#region Web Form Designer generated code
66		override protected void OnInit(EventArgs e)
67		{
68			//
69			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
70			//
71			InitializeComponent();
72			base.OnInit(e);
73			DataBind();
74		}
75		
76		/// <summary>
77		/// Required method for Designer support - do not modify
78		/// the contents of this method with the code editor.
79		/// </summary>
80		private void InitializeComponent()
81		{    
82			this.Button1.Click += new System.EventHandler(this.Button1_Click);
83			this.Load += new System.EventHandler(this.Page_Load);
84
85		}
86		#endregion
87
88	}
89}