private void cmdDisplay1_Click(object sender, EventArgs e)
        {
            try
            {
                String strDivisionID = cmbDivision.SelectedValue.ToString();

                DataSet dataSetReport = new DataSet();
                dataSetReport = myReports.getCheckRollReconcilation(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString()), (cmbDivision.SelectedValue.ToString()));
                dataSetReport.WriteXml("CheckRollReconcilation.xml");

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

                    myaclist.SetParameterValue("Company Name", FTSPayRollBL.Company.getCompanyName());
                    myaclist.SetParameterValue("Estate", "Estate :" + myDiv.ListEstates().Rows[0][0].ToString());
                    myaclist.SetParameterValue("Division Name", myDiv.EstateDivision(strDivisionID).Tables[0].Rows[0][0].ToString());
                    myaclist.SetParameterValue("Period", "Month of " + cmbMonth.Text + "/" + cmbYear.Text);
                    myReportViewer.crystalReportViewer1.ReportSource = myaclist;
                    myReportViewer.Show();
                }
                else
                {
                    MessageBox.Show("No Data to Preview..!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CheckRollReconcilationRPT1 rpt = new CheckRollReconcilationRPT1();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void btnView_Click(object sender, EventArgs e)
        {
            try
            {
                String strMonth = cmbMonth.Text;

                for (int month = 1; month <= 12; month++)
                {
                    if (strMonth == myMonth.ListMonths().Rows[month - 1][1].ToString())
                    {
                        DataTable dt = new DataTable();
                        dt = myRe.GetReconciliation(cmbYear.Text, month);

                        if (dt.Rows.Count > 0)
                        {
                            DataSet ds = new DataSet();
                            ds.Tables.Add(dt);
                            ds.WriteXml("ChkReconciliation.xml");

                            CheckRollReconcilationRPT1 myaclist = new CheckRollReconcilationRPT1();
                            myaclist.SetDataSource(ds);
                            ReportViewer myReportViewer = new ReportViewer();

                            myaclist.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName());
                            myaclist.SetParameterValue("Estate", "Estate :" + myDiv.ListEstates().Rows[0][0].ToString());
                            myaclist.SetParameterValue("Period", "Month of " + cmbMonth.Text + "/" + cmbYear.Text);
                            myReportViewer.crystalReportViewer1.ReportSource = myaclist;
                            myReportViewer.Show();
                        }
                        else
                        {
                            MessageBox.Show("No Data to Preview..!");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Occurred..!" + ex);
            }
        }