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

            rpt.Site = this.Site;
            return(rpt);
        }
        private void btnPayeeDetails_Click(object sender, EventArgs e)
        {
            DataSet      ds             = new DataSet();
            ReportViewer myReportViewer = new ReportViewer();

            if (chkAll.Checked)
            {
                ds = myReport.payeeLoanDeductionList("%", cmbYear.Text, cmbMonth.SelectedValue.ToString(), cmbDeduction.SelectedValue.ToString(), cmbDeductionGroup.SelectedValue.ToString());

                if (ds.Tables[0].Rows.Count > 0)
                {
                    ds.WriteXml("PayeeDeductionList.xml");
                    PayeeDeductionAccNoList myDeducReport = new PayeeDeductionAccNoList();
                    myDeducReport.SetDataSource(ds);

                    myDeducReport.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName());
                    myDeducReport.SetParameterValue("Estate", "Estate :" + myDiv.ListEstate().Rows[0][1].ToString());
                    myDeducReport.SetParameterValue("Division", "Division : For all Divisions");
                    myDeducReport.SetParameterValue("Period", "For the Month of :" + cmbMonth.Text + "  /  " + cmbYear.Text);
                    myDeducReport.SetParameterValue("Deduction", "Payee Loan Recovery - " + myDeduction.GetLoanName(cmbDeduction.SelectedValue.ToString()));

                    myReportViewer.crystalReportViewer1.ReportSource = myDeducReport;
                    myReportViewer.Show();
                }
                else
                {
                    MessageBox.Show("No Data to Preview..!");
                }
            }
            else
            {
                ds = myReport.payeeLoanDeductionList(cmbDivision.Text, cmbYear.Text, cmbMonth.SelectedValue.ToString(), cmbDeduction.SelectedValue.ToString(), cmbDeductionGroup.SelectedValue.ToString());
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ds.WriteXml("PayeeDeductionList.xml");
                    PayeeDeductionAccNoList myDeducReport = new PayeeDeductionAccNoList();
                    myDeducReport.SetDataSource(ds);

                    myDeducReport.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName());
                    myDeducReport.SetParameterValue("Estate", "Estate :" + myDiv.ListEstate().Rows[0][1].ToString());
                    myDeducReport.SetParameterValue("Division", "Division : " + cmbDivision.Text);
                    myDeducReport.SetParameterValue("Period", "For the Month of :" + cmbMonth.Text + "  /  " + cmbYear.Text);
                    myDeducReport.SetParameterValue("Deduction", "Payee Loan Recovery - " + myDeduction.GetLoanName(cmbDeduction.SelectedValue.ToString()));

                    myReportViewer.crystalReportViewer1.ReportSource = myDeducReport;
                    myReportViewer.Show();
                }
                else
                {
                    MessageBox.Show("No Data to Preview..!");
                }
            }
        }