public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { Lost rpt = new Lost(); rpt.Site = this.Site; return(rpt); }
private void LostViewbtn_Click(object sender, EventArgs e) { if (LostViewrbtn.Checked == true) { LostQtytxt.Clear(); LostItemtxt.Clear(); LostQtytxt.Enabled = false; LostItemtxt.Enabled = false; BalloonKingdomDataSetTableAdapters.InventoryTableAdapter lost = new WindowsApplication1.BalloonKingdomDataSetTableAdapters.InventoryTableAdapter(); DataTable datatable = lost.ViewLostQty(); Lost_Item rpt = new Lost_Item(); Lost lostit = new Lost(); lostit.SetDataSource(datatable); rpt.AssignLost(lostit); rpt.Show(); } else if (LostQtyrbtn.Checked == true) { if (LostQtytxt.Text != "") { int a = Convert.ToInt32(LostQtytxt.Text); BalloonKingdomDataSetTableAdapters.Rented_ItemsTableAdapter los = new WindowsApplication1.BalloonKingdomDataSetTableAdapters.Rented_ItemsTableAdapter(); DataTable datatable = los.LostCOF(a); Lost_Item rpt = new Lost_Item(); LostCOFNo loss = new LostCOFNo(); loss.SetDataSource(datatable); rpt.AssignCOF(loss); rpt.Show(); } else { MessageBox.Show("Please enter COF Number", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { if (LostItemtxt.Text != "") { int a = Convert.ToInt32(LostItemtxt.Text); BalloonKingdomDataSetTableAdapters.InventoryTableAdapter lostitem = new WindowsApplication1.BalloonKingdomDataSetTableAdapters.InventoryTableAdapter(); DataTable datatable = lostitem.Itemid(a); Lost_Item rpt = new Lost_Item(); Lost losts = new Lost(); losts.SetDataSource(datatable); rpt.AssignLost(losts); rpt.Show(); } else { MessageBox.Show("Please enter Item ID", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
public void AssignLost(Lost rpt) { crystalReportViewer1.ReportSource = rpt; }