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

            rpt.Site = this.Site;
            return(rpt);
        }
        private void btnBlkPlk_Click(object sender, EventArgs e)
        {
            DataSet  ds = new DataSet();
            DateTime Fromdate;
            DateTime Todate;
            String   strDivision = cmbDivision.SelectedValue.ToString();

            if (chkDivision.Checked)
            {
                MessageBox.Show("Please Select a One Division");
                cmbDivision.Focus();
            }
            else
            {
                strDivision = cmbDivision.SelectedValue.ToString();
                Fromdate    = Convert.ToDateTime(dtpFromDate.Value.Date.ToShortDateString());
                Todate      = Convert.ToDateTime(dtpToDate.Value.Date.ToShortDateString());
                ds          = clsReports.ListBlockPluckingDetails(Fromdate, Todate, strDivision);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ds.WriteXml("BlockPlkDetails.xml");
                    DivisionWiseBlockPlkSummary myReportViewe = new DivisionWiseBlockPlkSummary();
                    myReportViewe.SetDataSource(ds);
                    myReportViewe.SetParameterValue("Estate", "Estate:" + myEstate.ListEstates().Rows[0][0].ToString() + " / DivisionID:" + cmbDivision.SelectedValue.ToString());
                    myReportViewe.SetParameterValue("Date", "From: " + Fromdate.ToShortDateString() + "  To: " + Todate.ToShortDateString());
                    myReportViewe.SetParameterValue("Company Name", FTSPayRollBL.Company.getCompanyName());
                    ReportViewer myReportViewer = new ReportViewer();
                    myReportViewer.crystalReportViewer1.ReportSource = myReportViewe;
                    myReportViewer.Show();
                }
                else
                {
                    MessageBox.Show("No Data To Print", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }