public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { expdatereport rpt = new expdatereport(); rpt.Site = this.Site; return(rpt); }
public frmExpireDateReport(string date) { InitializeComponent(); string expiredate = date; con.Open(); DataSet1 ds = new DataSet1(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "select i.itemname ,ib.itemid, ib.batchid,ib.expdate,ib.quantity ,'" + expiredate + "' as date from ItemBatch ib inner join item i on i.itemid = ib.itemid where ExpDate< '" + expiredate + "'"; cmd.ExecuteNonQuery(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds.DataTable2); expdatereport myr = new expdatereport(); myr.SetDataSource(ds); crystalReportViewer1.ReportSource = myr; }