public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { WorstSellingProducts rpt = new WorstSellingProducts(); rpt.Site = this.Site; return(rpt); }
private void LoadLowSellingProducts() { WorstSellingProducts aWorseProductsRep = new WorstSellingProducts(); try { //Instantiate the dataset and table adapters aDataSet = new ReportDataSet(); aWorseProductsAdapter = new ReportDataSetTableAdapters.WorstSellingProductsTableAdapter(); //Fill the dataset aWorseProductsAdapter.Fill(aDataSet.WorstSellingProducts); //Assign the filled dataset as the data source for the report aWorseProductsRep.SetDataSource(aDataSet); //Set up the report viewer object on the form //show the runtime report object crvReports.ReportSource = aWorseProductsRep; } catch (Exception ex) { //catch an exception thrown during data object intonation //or report generation and display based on the dataset MessageBox.Show("Data Error Encountered" + ex.ToString(), "ERROR"); } }