| 1: | using System; | |
| 2: | using System.Collections; | |
| 3: | using System.ComponentModel; | |
| 4: | using System.Data; | |
| 5: | using System.Drawing; | |
| 6: | using System.Web; | |
| 7: | using System.Web.SessionState; | |
| 8: | using System.Web.UI; | |
| 9: | using System.Web.UI.WebControls; | |
| 10: | using System.Web.UI.HtmlControls; | |
| 11: | using BarcodeNETWorkShop; | |
| 12: | using BarcodeNETWorkShop.Core; | |
| 13: | using System.IO; | |
| 14: | using System.Drawing.Imaging; | |
| 15: | ||
| 16: | namespace WebCrystalReportCS | |
| 17: | { | |
| 18: | /// <summary> | |
| 19: | /// Summary description for ExampleCS. | |
| 20: | /// </summary> | |
| 21: | public class ExampleCS : System.Web.UI.Page | |
| 22: | { | |
| 23: | protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1; | |
| 24: | protected System.Data.SqlClient.SqlCommand sqlCommand1; | |
| 25: | protected System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1; | |
| 26: | protected BarcodeNETCrystalReportCS.DataSet1 dataSet11; | |
| 27: | protected BarcodeNETWorkShop.BarcodeNETImage BarcodeNETImage1; | |
| 28: | protected System.Data.SqlClient.SqlConnection sqlConnection1; | |
| 29: | ||
| 30: | private void Page_Load(object sender, System.EventArgs e) | |
| 31: | { | |
| 32: | // Put user code to initialize the page here | |
| 33: | sqlDataAdapter1.Fill(dataSet11,"Employees"); | |
| 34: | CrystalReport1 myReport1=new CrystalReport1(); | |
| 35: | foreach (DataRow dr in dataSet11.Tables["Employees"].Rows) | |
| 36: | { | |
| 37: | BarcodeNETImage1.BarcodeText=dr["firstname"].ToString(); | |
| 38: | dr["barcodeimages"] =BarcodeNETImage1.GetBarcodeBitmap(FILE_FORMAT.PNG); | |
| 39: | } | |
| 40: | ||
| 41: | myReport1.SetDataSource(dataSet11); | |
| 42: | CrystalReportViewer1.ReportSource=myReport1; | |
| 43: | CrystalReportViewer1.DataBind(); | |
| 44: | } | |
| 45: | ||
| 46: | #region Web Form Designer generated code | |
| 47: | override protected void OnInit(EventArgs e) | |
| 48: | { | |
| 49: | // | |
| 50: | // CODEGEN: This call is required by the ASP.NET Web Form Designer. | |
| 51: | // | |
| 52: | InitializeComponent(); | |
| 53: | base.OnInit(e); | |
| 54: | } | |
| 55: | ||
| 56: | /// <summary> | |
| 57: | /// Required method for Designer support - do not modify | |
| 58: | /// the contents of this method with the code editor. | |
| 59: | /// </summary> | |
| 60: | private void InitializeComponent() | |
| 61: | { | |
| 62: | this.sqlConnection1 = new System.Data.SqlClient.SqlConnection(); | |
| 63: | this.sqlCommand1 = new System.Data.SqlClient.SqlCommand(); | |
| 64: | this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter(); | |
| 65: | this.dataSet11 = new BarcodeNETCrystalReportCS.DataSet1(); | |
| 66: | ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit(); | |
| 67: | // | |
| 68: | // sqlConnection1 | |
| 69: | // | |
| 70: | this.sqlConnection1.ConnectionString = "server=(local);database=northwind;Trusted_Connection=yes"; | |
| 71: | // | |
| 72: | // sqlCommand1 | |
| 73: | // | |
| 74: | this.sqlCommand1.CommandText = "SELECT Employees.* FROM Employees"; | |
| 75: | this.sqlCommand1.Connection = this.sqlConnection1; | |
| 76: | // | |
| 77: | // sqlDataAdapter1 | |
| 78: | // | |
| 79: | this.sqlDataAdapter1.SelectCommand = this.sqlCommand1; | |
| 80: | // | |
| 81: | // dataSet11 | |
| 82: | // | |
| 83: | this.dataSet11.DataSetName = "DataSet1"; | |
| 84: | this.dataSet11.Locale = new System.Globalization.CultureInfo("en-US"); | |
| 85: | this.Load += new System.EventHandler(this.Page_Load); | |
| 86: | ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit(); | |
| 87: | ||
| 88: | } | |
| 89: | #endregion | |
| 90: | } | |
| 91: | } |
This page was automatically generated by SharpDevelop.