public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            EmpWorkHistory rpt = new EmpWorkHistory();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            DataSet  dataSetReport = new DataSet();
            DateTime dtStartDate, dtEndDate;
            String   strAllEmp = "%";

            dtStartDate = myEmpwork.GetStartDate(int.Parse(cmbYear.Text.ToString()), int.Parse(cmbMonth.SelectedValue.ToString()));
            dtEndDate   = myEmpwork.GetEndDateOfMonth(dtStartDate);
            if (chkAll.Checked)
            {
                strAllEmp = "%";
            }
            else
            {
                strAllEmp = cmbEmpNo.SelectedValue.ToString();
            }
            dataSetReport = myEmpwork.GetEmpWorkHis(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString()), cmbDivisionID.SelectedValue.ToString(), strAllEmp);

            if (dataSetReport.Tables[0].Rows.Count > 0)
            {
                dataSetReport.WriteXml("EmpWorkHistory.xml");

                EmpWorkHistory EmpWrkHis = new EmpWorkHistory();
                EmpWrkHis.SetDataSource(dataSetReport);

                EmpWrkHis.SetParameterValue("Estate", "Estate :" + mydiv.ListEstates().Rows[0][0].ToString());
                EmpWrkHis.SetParameterValue("Period", "For the month :" + cmbMonth.Text + "  /  " + cmbYear.Text);
                ReportViewer myRepView = new ReportViewer();
                myRepView.crystalReportViewer1.ReportSource = EmpWrkHis;
                myRepView.Show();
            }
            else
            {
                MessageBox.Show("No Data to Preview");
            }
        }