Esempio n. 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            ProductsToTurnProfit rpt = new ProductsToTurnProfit();

            rpt.Site = this.Site;
            return(rpt);
        }
Esempio n. 2
0
        private void LoadProductsProfit()
        {
            ProductsToTurnProfit aProfitRep = new ProductsToTurnProfit();

            try
            {
                //Instantiate the dataset and table adapters
                aDataSet       = new ReportDataSet();
                aProfitAdapter = new ReportDataSetTableAdapters.ProductsToTurnProfitTableAdapter();
                //Fill the dataset
                aProfitAdapter.Fill(aDataSet.ProductsToTurnProfit);
                //Assign the filled dataset as the data source for the report
                aProfitRep.SetDataSource(aDataSet);
                //Set up the report viewer object on the form
                //show the runtime report object
                crvReports.ReportSource = aProfitRep;
            }
            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");
            }
        }