Beispiel #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            LoanDeductionRegisterRPT rpt = new LoanDeductionRegisterRPT();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void cmdDisplay2_Click(object sender, EventArgs e)
        {
            DataSet dataSetReport = new DataSet();

            if (chkAllEmp.Checked == true)
            {
                if (chkPayeeDetails.Checked)
                {
                    dataSetReport = myReports.GetLoanDeductionRegisterWithPayees(cmbDivision.Text, Convert.ToInt32(cmbYear.SelectedValue.ToString()), Convert.ToInt32(cmbMonth.SelectedValue.ToString()), Convert.ToInt32(cmbDeductionGroup.SelectedValue.ToString()), Convert.ToInt32(cmbDeductions.SelectedValue.ToString()));
                }
                else
                {
                    dataSetReport = myReports.GetLoanDeductionRegister(cmbDivision.Text, Convert.ToInt32(cmbYear.SelectedValue.ToString()), Convert.ToInt32(cmbMonth.SelectedValue.ToString()), Convert.ToInt32(cmbDeductionGroup.SelectedValue.ToString()), Convert.ToInt32(cmbDeductions.SelectedValue.ToString()));
                }
            }
            else
            {
                String empNoFrom = txtEmpFrom.Text.ToString();
                String empNoTo   = txtEmpTo.Text.ToString();;

                dataSetReport = myReports.GetLoanDeductionRegisterByEmpRange(cmbDivision.Text, Convert.ToInt32(cmbYear.SelectedValue.ToString()), Convert.ToInt32(cmbMonth.SelectedValue.ToString()), Convert.ToInt32(cmbDeductionGroup.SelectedValue.ToString()), Convert.ToInt32(cmbDeductions.SelectedValue.ToString()), empNoFrom, empNoTo);
            }

            if (chkPayeeDetails.Checked)
            {
                dataSetReport.WriteXml("LoanDeductionsRegisterWithPayees.xml");
                LoanDeductionRegisterWithPayeesRPT myaclist = new LoanDeductionRegisterWithPayeesRPT();
                myaclist.SetDataSource(dataSetReport);
                ReportViewer myReportViewer = new ReportViewer();
                myaclist.SetParameterValue("Company Name", FTSPayRollBL.Company.getCompanyName());
                myaclist.SetParameterValue("Month", cmbMonth.Text + " / " + cmbYear.Text);
                myaclist.SetParameterValue("Division", cmbDivision.Text);
                myReportViewer.crystalReportViewer1.ReportSource = myaclist;
                myReportViewer.Show();
            }
            else
            {
                dataSetReport.WriteXml("LoanDeductionsRegister.xml");
                LoanDeductionRegisterRPT myaclist = new LoanDeductionRegisterRPT();
                myaclist.SetDataSource(dataSetReport);
                ReportViewer myReportViewer = new ReportViewer();
                myaclist.SetParameterValue("Company Name", FTSPayRollBL.Company.getCompanyName());
                myaclist.SetParameterValue("Month", cmbMonth.Text + " / " + cmbYear.Text);
                myaclist.SetParameterValue("Division", cmbDivision.Text);
                myReportViewer.crystalReportViewer1.ReportSource = myaclist;
                myReportViewer.Show();
            }
        }