/Reports/InvPickupList.aspx.cs
C# | 88 lines | 66 code | 12 blank | 10 comment | 2 complexity | 2c9d651463d85ea6a3afafdbf47bda8d 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 InvPickupListWebForm : 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 InvPickupList crReport = new InvPickupList(); 27 string paramName= "InvItem_ID"; 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 rm.SetPrinter(Request.UserHostAddress); 46 Boolean x = rm.printReport(crReport, CrystalReportViewer1, param, paramName); 47 if(x) 48 { 49 Response.Write("<br><br><br><br><br><br><br><br><br><br><br><br><br><font face=titr color=red size=5><center>"); 50 Response.Write("����� ����� �� �� �ǁ�� <br>"); 51 Response.Write(" ���� ����"+crReport.PrintOptions.PrinterName); 52 Response.Write("</center></font>"); 53 } 54 else 55 { 56 Response.Write ("error: Problem in printing report"); 57 Response.End(); 58 } 59 60 61 } 62 63 64 #region Web Form Designer generated code 65 override protected void OnInit(EventArgs e) 66 { 67 // 68 // CODEGEN: This call is required by the ASP.NET Web Form Designer. 69 // 70 InitializeComponent(); 71 base.OnInit(e); 72 DataBind(); 73 } 74 75 /// <summary> 76 /// Required method for Designer support - do not modify 77 /// the contents of this method with the code editor. 78 /// </summary> 79 private void InitializeComponent() 80 { 81 this.Button1.Click += new System.EventHandler(this.Button1_Click); 82 this.Load += new System.EventHandler(this.Page_Load); 83 84 } 85 #endregion 86 87 } 88}