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

            rpt.Site = this.Site;
            return(rpt);
        }
        private void cmdDisplay2_Click(object sender, EventArgs e)
        {
            String AllCat = "%";

            if (chkAllCat.Checked)
            {
                AllCat = "%";
            }
            else
            {
                AllCat = cmbEmpCat.SelectedValue.ToString();
            }
            try
            {
                if (chkAllDivisions.Checked == true)
                {
                    dataSetReport = myReports.getPaymentCheckRollII(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString()), AllCat);
                    dataSetReport.WriteXml("PaymentCheckRollII.xml");

                    if (dataSetReport.Tables[0].Rows.Count > 0)
                    {
                        PaymentCheckrollRPTII myaclist = new PaymentCheckrollRPTII();
                        myaclist.SetDataSource(dataSetReport);
                        ReportViewer myReportViewer = new ReportViewer();

                        myaclist.SetParameterValue("Company Name", FTSPayRollBL.Company.getCompanyName());
                        myaclist.SetParameterValue("Estate", myDivision.ListEstate().Rows[0][1].ToString());
                        myaclist.SetParameterValue("paramDivision", "ALL");
                        myaclist.SetParameterValue("paramYearMonth", cmbMonth.Text + "  /  " + cmbYear.Text);
                        myReportViewer.crystalReportViewer1.ReportSource = myaclist;
                        myReportViewer.Show();
                    }
                    else
                    {
                        MessageBox.Show("No Data to Preview..!");
                    }
                }
                else
                {
                    dataSetReport = myReports.getPaymentCheckRollII(cmbDivision.SelectedValue.ToString(), Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString()), AllCat);
                    dataSetReport.WriteXml("PaymentCheckRollII.xml");

                    if (dataSetReport.Tables[0].Rows.Count > 0)
                    {
                        PaymentCheckrollRPTII myaclist = new PaymentCheckrollRPTII();
                        myaclist.SetDataSource(dataSetReport);
                        ReportViewer myReportViewer = new ReportViewer();

                        myaclist.SetParameterValue("Company Name", FTSPayRollBL.Company.getCompanyName());
                        myaclist.SetParameterValue("Estate", myDivision.ListEstate().Rows[0][1].ToString());
                        myaclist.SetParameterValue("paramDivision", cmbDivision.Text);
                        myaclist.SetParameterValue("paramYearMonth", cmbMonth.Text + "  /  " + cmbYear.Text);
                        myReportViewer.crystalReportViewer1.ReportSource = myaclist;
                        myReportViewer.Show();
                    }
                    else
                    {
                        MessageBox.Show("No Data to Preview..!");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }