public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CustomerFname rpt = new CustomerFname(); rpt.Site = this.Site; return(rpt); }
public void AssignFname(CustomerFname rpt) { crystalReportViewer1.ReportSource = rpt; }
private void CustViewbtn_Click(object sender, EventArgs e) { if (CustIDrbtn.Checked == true) { CustIDfrmtxt.Text = ""; CustIDuptxt.Text = ""; CustLasFrmtxt.Text = ""; CustLasUptxt.Text = ""; CustIDfrmtxt.Enabled = false; CustIDuptxt.Enabled = false; CustLasFrmtxt.Enabled = false; CustLasUptxt.Enabled = false; BalloonKingdomDataSetTableAdapters.CustomerTableAdapter cust2 = new WindowsApplication1.BalloonKingdomDataSetTableAdapters.CustomerTableAdapter(); DataTable datatable = cust2.ViewCustomer(); Customer_Masterlist rpt = new Customer_Masterlist(); CrystalReport1 custrpt = new CrystalReport1(); custrpt.SetDataSource(datatable); rpt.AssignCustReport(custrpt); rpt.Show(); } else if (Custidbtn.Checked == true) { if (CustIDfrmtxt.Text != "" && CustIDuptxt.Text == "") { MessageBox.Show("Enter up to id first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (CustIDfrmtxt.Text == "" && CustIDuptxt.Text != "") { MessageBox.Show("Enter from id first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (CustIDfrmtxt.Text == "" && CustIDuptxt.Text == "") { MessageBox.Show("Enter from and up to id first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { int a = Convert.ToInt32(CustIDfrmtxt.Text); int b = Convert.ToInt32(CustIDuptxt.Text); BalloonKingdomDataSetTableAdapters.CustomerTableAdapter bend2 = new WindowsApplication1.BalloonKingdomDataSetTableAdapters.CustomerTableAdapter(); DataTable datatable = bend2.CustIDBeginEnd(a, b); Customer_Masterlist rpt = new Customer_Masterlist(); CustomerFname custrpt2 = new CustomerFname(); custrpt2.SetDataSource(datatable); rpt.AssignFname(custrpt2); rpt.Show(); } } else { if (CustLasFrmtxt.Text != "" && CustLasUptxt.Text == "") { MessageBox.Show("Enter up to name first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (CustLasFrmtxt.Text == "" && CustLasUptxt.Text != "") { MessageBox.Show("Enter from name first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (CustLasFrmtxt.Text == "" && CustLasUptxt.Text == "") { MessageBox.Show("Enter from and up to name first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { string a = Convert.ToString(CustLasFrmtxt.Text); string b = Convert.ToString(CustLasUptxt.Text); BalloonKingdomDataSetTableAdapters.CustomerTableAdapter bend = new WindowsApplication1.BalloonKingdomDataSetTableAdapters.CustomerTableAdapter(); DataTable datatable = bend.CustBeginEnd(a, b); Customer_Masterlist rpt = new Customer_Masterlist(); CustomerLname custrpt3 = new CustomerLname(); custrpt3.SetDataSource(datatable); rpt.AssignLname(custrpt3); rpt.Show(); } } }