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

            rpt.Site = this.Site;
            return(rpt);
        }
        private void GetEmployeeSalaryHistory(DateTime payrollDate)
        {
            try
            {
                ReportBAL        objReportBal    = new ReportBAL();
                DataTable        dtReportBal     = new DataTable();
                cr_SalaryHistory objEmployee     = new cr_SalaryHistory();
                frmReportViewer  objReportviewer = new frmReportViewer();

                dtReportBal = objReportBal.GetEmployeeSalaryHistory(payrollDate);
                objEmployee.SetDataSource(dtReportBal);

                GetCommonInfo();
                ((TextObject)objEmployee.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName;
                ((TextObject)objEmployee.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text     = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;

                ((TextObject)objEmployee.ReportDefinition.Sections[2].ReportObjects["txtReport"]).Text = "Salary History For the Month of " + payrollDate.ToString("MMMM-yyyy");



                objReportviewer.crvReportViewer.ReportSource     = objEmployee;
                objReportviewer.crvReportViewer.DisplayGroupTree = false;
                objReportviewer.Text = "Salary Sheet of " + payrollDate.ToString("MMMM,yyyy");
                objReportviewer.Show();
            }
            catch (Exception)
            {
                throw;
            }
        }