private void report_Click(object sender, EventArgs e) { printSaleForm printForm = new printSaleForm(); stockDataSet dataSet = new stockDataSet(); dataSet.EnforceConstraints = false; viewExpireStockReport report = new viewExpireStockReport(); try { adapter1.Fill(dataSet.addStock); adapter2.Fill(dataSet.medicine); report.SetDataSource(dataSet); printForm.crystalReportViewer1.ReportSource = report; printForm.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { viewExpireStockReport rpt = new viewExpireStockReport(); rpt.Site = this.Site; return(rpt); }