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

            rpt.Site = this.Site;
            return(rpt);
        }
        private void frmConsolidateReportsCertificados_Load(object sender, EventArgs e)
        {
            using (new LoadingClass.PleaseWait(this.Location, "Generando..."))
            {
                rp = new Reports.crConsolidatedCertificados();

                foreach (var com in _componentId)
                {
                    ChooseReport(rp, com);
                }

                crystalReportViewer1.EnableDrillDown = false;
                crystalReportViewer1.ReportSource    = rp;

                ReportDocument repDoc = rp;

                repDoc.ExportOptions.ExportFormatType      = ExportFormatType.PortableDocFormat;
                repDoc.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
                DiskFileDestinationOptions objDiskOpt = new DiskFileDestinationOptions();
                objDiskOpt.DiskFileName = Application.StartupPath + @"\TempMerge\Crystal2.pdf";
                repDoc.ExportOptions.DestinationOptions = objDiskOpt;
                repDoc.Export();



                //crystalReportViewer1.Show();
            }
        }
        private void frmConsolidateReportsCertificados_Load(object sender, EventArgs e)
        {
            using (new LoadingClass.PleaseWait(this.Location, "Generando..."))
            {
                rp = new Reports.crConsolidatedCertificados();

                foreach (var com in _componentId)
                {
                    ChooseReport(rp, com);
                }

                crystalReportViewer1.EnableDrillDown = false;
                crystalReportViewer1.ReportSource    = rp;
                crystalReportViewer1.Show();
            }
        }
        private void ChooseReport(crConsolidatedCertificados rp, string componentId)
        {
            DataSet ds = null;

            switch (componentId)
            {
            case Constants.INFORME_CERTIFICADO_APTITUD_EMPRESARIAL:

                ds = GetReportCAPE();
                rp.Subreports["crCertificadoDeAptitudEmpresarial.rpt"].SetDataSource(ds);
                rp.CAPE.SectionFormat.EnableSuppress = false;
                break;

            case Constants.INFORME_CERTIFICADO_APTITUD_SM:

                ds = GetReportCAPSM();
                rp.Subreports["crCertficadoDeAptitudSM.rpt"].SetDataSource(ds);
                rp.CAPSM.SectionFormat.EnableSuppress = false;
                break;

            case Constants.INFORME_CERTIFICADO_APTITUD_COMPLETO:

                ds = GetReportCAPC();
                rp.Subreports["crCertificadoDeAptitudCompleto.rpt"].SetDataSource(ds);
                rp.CAPC.SectionFormat.EnableSuppress = false;
                break;

            case Constants.INFORME_CERTIFICADO_APTITUD_SIN_DX:

                ds = GetReportCAPSD();
                rp.Subreports["crCertificadoDeAptitudSinDX.rpt"].SetDataSource(ds);
                rp.CAPSD.SectionFormat.EnableSuppress = false;
                break;

            default:
                break;
            }
        }