public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            ItemStatus rpt = new ItemStatus();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void InvViewbtn_Click(object sender, EventArgs e)
        {
            if (ItemIDbtn.Checked == true)
            {
                if (InvFrmtxt.Text != "" && InvUptxt.Text == "")
                {
                    MessageBox.Show("Enter up to item id first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }

                else if (InvFrmtxt.Text == "" && InvUptxt.Text != "")
                {
                    MessageBox.Show("Enter from item id first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }

                if (InvFrmtxt.Text == "" && InvUptxt.Text == "")
                {
                    MessageBox.Show("Enter from and up to item id first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    int a = Convert.ToInt32(InvFrmtxt.Text);
                    int b = Convert.ToInt32(InvUptxt.Text);

                    BalloonKingdomDataSetTableAdapters.InventoryTableAdapter begin = new WindowsApplication1.BalloonKingdomDataSetTableAdapters.InventoryTableAdapter();
                    DataTable datatable = begin.InvBeginEnd(a, b);

                    Inventory_Masterlist rpt = new Inventory_Masterlist();

                    InventoryID invrpt = new InventoryID();
                    invrpt.SetDataSource(datatable);

                    rpt.AssignInvReport(invrpt);
                    rpt.Show();
                }
            }

            else if (Itemnmebtn.Checked == true)
            {
                BalloonKingdomDataSetTableAdapters.InventoryTableAdapter inv2 = new WindowsApplication1.BalloonKingdomDataSetTableAdapters.InventoryTableAdapter();
                DataTable datatable = inv2.GetAllInventoryRec();


                Inventory_Masterlist rpt = new Inventory_Masterlist();


                ItemName invname = new ItemName();
                invname.SetDataSource(datatable);

                rpt.AssignInvname(invname);
                rpt.Show();
            }
            else
            {
                BalloonKingdomDataSetTableAdapters.InventoryTableAdapter inv2 = new WindowsApplication1.BalloonKingdomDataSetTableAdapters.InventoryTableAdapter();
                DataTable datatable = inv2.GetAllInventoryRec();


                Inventory_Masterlist rpt = new Inventory_Masterlist();


                ItemStatus invstat = new ItemStatus();
                invstat.SetDataSource(datatable);

                rpt.AssignInvStat(invstat);
                rpt.Show();
            }
        }
 public void AssignInvStat(ItemStatus rpt)
 {
     crystalReportViewer1.ReportSource = rpt;
 }