Example #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            SupplierName rpt = new SupplierName();

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
 public void AssignSuppname(SupplierName rpt)
 {
     crystalReportViewer1.ReportSource = rpt;
 }
        private void SuppViewbtn_Click(object sender, EventArgs e)
        {
            if (SuppIDbtn.Checked == true)
            {
                if ((SupIDFrmtxt.Text != "" && SupIDUptxt.Text == "") || (SupIDFrmtxt.Text == "" && SupIDUptxt.Text != "") || (SupIDFrmtxt.Text == "" && SupIDUptxt.Text == ""))
                {
                    MessageBox.Show("Enter id first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    int a = Convert.ToInt32(SupIDFrmtxt.Text);
                    int b = Convert.ToInt32(SupIDUptxt.Text);

                    BalloonKingdomDataSetTableAdapters.SupplierTableAdapter supp = new WindowsApplication1.BalloonKingdomDataSetTableAdapters.SupplierTableAdapter();
                    DataTable datatable = supp.SuppBeginEnd(a, b);

                    Supplier_Masterlist rpt = new Supplier_Masterlist();


                    SupplierID supprpt = new SupplierID();
                    supprpt.SetDataSource(datatable);

                    rpt.AssignSuppReport(supprpt);
                    rpt.Show();
                }
            }

            else if (Suppnmebtn.Checked == true)
            {
                if ((SupNameFrmtxt.Text != "" && SupNameUptxt.Text == "") || (SupNameFrmtxt.Text == "" && SupNameUptxt.Text != "") || (SupNameFrmtxt.Text == "" && SupNameUptxt.Text == ""))
                {
                    MessageBox.Show("Enter name first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }

                string a = Convert.ToString(SupNameFrmtxt.Text);
                string b = Convert.ToString(SupNameUptxt.Text);

                BalloonKingdomDataSetTableAdapters.SupplierTableAdapter sup = new WindowsApplication1.BalloonKingdomDataSetTableAdapters.SupplierTableAdapter();
                DataTable datatable = sup.Supnme(a, b);

                Supplier_Masterlist rpt = new Supplier_Masterlist();


                SupplierName supprpt2 = new SupplierName();
                supprpt2.SetDataSource(datatable);

                rpt.AssignSuppname(supprpt2);
                rpt.Show();
            }

            else
            {
                BalloonKingdomDataSetTableAdapters.SupplierTableAdapter supp2 = new WindowsApplication1.BalloonKingdomDataSetTableAdapters.SupplierTableAdapter();
                DataTable datatable = supp2.ViewAllSupplier();



                Supplier_Masterlist rpt = new Supplier_Masterlist();


                SupplierID supprpt = new SupplierID();
                supprpt.SetDataSource(datatable);

                rpt.AssignSuppReport(supprpt);
                rpt.Show();
            }
        }