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

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
0
        Stream ProjectBasedReport(string mrfid, string applicants)
        {
            DataTable dt = new Contracts.sp_print_contractDataTable();

            foreach (var applicant in applicants.Split(','))
            {
                foreach (var i in db.sp_print_contract(mrfid, applicant))
                {
                    dt.Rows.Add(i.surname, i.firstname, i.middleinitial, i.address, i.ProjectName, i.BusinessUnit, i.Classification, i.position_name, i.company_name, i.branch, i.officeaddress);
                }
            }
            var report       = new ReportDocument();
            var BusinessUnit = mrfid.Split('-')[0];

            if (BusinessUnit == "TOPSERVE")
            {
                report = new ProjectBasedA();
            }
            else if (BusinessUnit == "CSI")
            {
                report = new Corestaff.ProjectBased.ProjectBaseCorestaffA();
            }
            else if (BusinessUnit == "IWSC")
            {
                report = new IWSC.ProjectBased.ProjectBasedIWSCA();
            }
            report.SetDataSource(dt);

            return(report.ExportToStream(ExportFormatType.WordForWindows));
        }