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

            rpt.Site = this.Site;
            return(rpt);
        }
        private void btnView_Click(object sender, EventArgs e)
        {
            FTSPayRollBL.Reports myDeduction = new FTSPayRollBL.Reports();

            if (allemp == true)
            {
                DataSet ds = new DataSet();
                myDeduction.StrDivisionID = cmbDivision.SelectedValue.ToString();
                myDeduction.IntMonth      = Convert.ToInt32(cmbMonth.SelectedValue.ToString());
                myDeduction.IntYear       = Convert.ToInt32(cmbYear.SelectedValue.ToString());
                ds = myDeduction.DivisionWiseDeductionRegisterAllEmp();
                ds.WriteXml("DivisionWiseDeductionRegisterAllEmp.xml");

                DivisionWiseDeductionRegisterAllEmp myDeductionAllEmp = new DivisionWiseDeductionRegisterAllEmp();
                myDeductionAllEmp.SetDataSource(ds);
                myDeductionAllEmp.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName());
                myDeductionAllEmp.SetParameterValue("Estate", "Estate : " + mydiv.ListEstates().Rows[0][0].ToString());
                myDeductionAllEmp.SetParameterValue("Division", "Division : " + cmbDivision.Text);
                myDeductionAllEmp.SetParameterValue("Period", "For the Month of : " + cmbMonth.Text + "  /  " + cmbYear.Text);

                ReportViewer myReportViewer = new ReportViewer();

                myReportViewer.crystalReportViewer1.ReportSource = myDeductionAllEmp;
                myReportViewer.Show();
            }

            else
            {
                DataSet ds = new DataSet();
                myDeduction.StrDivisionID = cmbDivision.SelectedValue.ToString();
                myDeduction.IntMonth      = Convert.ToInt32(cmbMonth.SelectedValue.ToString());
                myDeduction.IntYear       = Convert.ToInt32(cmbYear.SelectedValue.ToString());
                ds = myDeduction.DivisionWiseDeductionRegisterAllEmp(cmbEmpNo.SelectedValue.ToString());
                ds.WriteXml("DivisionWiseDeductionRegisterAllEmp.xml");


                DivisionWiseDeductionRegisterAllEmp myDeductionAllEmp = new DivisionWiseDeductionRegisterAllEmp();
                myDeductionAllEmp.SetDataSource(ds);
                myDeductionAllEmp.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName());
                myDeductionAllEmp.SetParameterValue("Estate", "Estate : " + mydiv.ListEstates().Rows[0][0].ToString());
                myDeductionAllEmp.SetParameterValue("Division", "Division : " + cmbDivision.Text);
                myDeductionAllEmp.SetParameterValue("Period", "For the Month of : " + cmbMonth.Text + "  /  " + cmbYear.Text);

                ReportViewer myReportViewer = new ReportViewer();

                myReportViewer.crystalReportViewer1.ReportSource = myDeductionAllEmp;
                myReportViewer.Show();
            }
        }