Пример #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            TotalExpenses rpt = new TotalExpenses();

            rpt.Site = this.Site;
            return(rpt);
        }
Пример #2
0
        private void LoadTotalExpenses()
        {
            TotalExpenses aTotalExpRep = new TotalExpenses();

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