Data from 2 Sub-reports appear in a report Main empty Crystal Report + MVC

0

I am putting together a report that involves inserting 2 linked sub-reports by 3 parameters, my problem persists when I insert 2 sub-reports in my main report, but when I insert only 1 if it shows me when I run my application and export the report.

Does anyone know what can be due to this or what is happening?

Thank you very much !!

My controller code

public ActionResult ExportarReporteVulcanizacion(string EspVulProdId, int EspVulVersionId, int EspVulItemId)
    {
        try
        {

            List<EspecVulcReporte> objListarEspecVulcItems = new List<EspecVulcReporte>();
            List<EspecVulcReporte> objListarEspecVulcEquipos = new List<EspecVulcReporte>();
            List<EspecVulcReporte> objListarEspecVulcCondiciones = new List<EspecVulcReporte>();

            objListarEspecVulcItems = oIEspecVulcItems.EspecVulcVersiones_Obtener_Reporte(EspVulProdId, EspVulVersionId, EspVulItemId);
            objListarEspecVulcEquipos = oIEspecVulcEquipos.EspecVulcEquipos_Obtener_Reporte(EspVulProdId, EspVulVersionId, EspVulItemId);
            objListarEspecVulcCondiciones = oIEspecVulcCondiciones.EspecVulcCondiciones_Obtener_Reporte(EspVulProdId, EspVulVersionId, EspVulItemId);

            ReportDocument rd = new ReportDocument();
            rd.Load(Path.Combine(Server.MapPath("~/Areas/ESPECVULCANIZACION/Reportes"), "Rpt_Vulcanizacion2.rpt"));
            rd.DataSourceConnections.Clear();

            rd.Subreports[0].DataSourceConnections.Clear();
            rd.SetDataSource(objListarEspecVulcItems);
            rd.Subreports[0].SetDataSource(objListarEspecVulcEquipos);
            rd.Subreports[1].SetDataSource(objListarEspecVulcCondiciones);

            Response.Buffer = false;
            Response.ClearContent();
            Response.ClearHeaders();

            Stream stream = rd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            stream.Seek(0, SeekOrigin.Begin);
            return File(stream, "application/pdf", "Rpt_Vulcanizacion.pdf");

        }
        catch (Exception)
        {
            throw;
        }

    }

Report with 2 subreports I link them for 3 parameters by removing the linkage check, Try putting it in the report footer to see if changing sections shows data, but it did not work.

Visualization of the report by the Crystal Report.

Exported report through a button in my web application. (When I only insert a subreport if it shows me data.)

    
asked by Jorge Guillén 07.12.2018 в 18:02
source

0 answers