| Author: Alagappan.PL 03 May 2007 | Member Level: Bronze | Rating: Points: 2 |
hi I assume that u have a crystal report with the name Employee.rpt
in the web wage drag and drop the crystal report viewer tool and add the crystal report file to the project (Employee.rpt) and make use of the following code
public class WebForm1 : System.Web.UI.Page { protected CrystalDecisions.Web.CrystalReportViewer ReportViewer1; public Employee emp = new Employee(); private void Page_Load(object sender, System.EventArgs e) { emp.SetDatabaseLogon("username","Password"); //Report to login to db ReportViewer1.ReportSource = emp ; }
#region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load);
} #endregion
|