Exemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            EmpEventRep rpt = new EmpEventRep();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemplo n.º 2
0
        private void LoadEmpEvent()
        {
            EmpEventRep aEmpEventRep = new EmpEventRep();

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