System.InvalidCastException: C1.C1Report.Section

Posted by: enrique.pv-ext on 10 July 2026, 7:27 am EST

  • Posted 10 July 2026, 7:27 am EST

            // System.InvalidCastException: '[A]C1.C1Report.Section no puede convertirse en [B]C1.C1Report.Section.
            // El tipo A se origina a partir de 'C1.C1Report.4.8, Version=4.8.20251.721, Culture=neutral, PublicKeyToken=594a0605db190bb9' en el contexto 'Default'
            // en la ubicación 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\C1.C1Report.4.8\v4.0_4.8.20251.721__594a0605db190bb9\C1.C1Report.4.8.dll'.
            // El tipo B se origina a partir de 'C1.C1Report.2, Version=2.6.20093.53207, Culture=neutral, PublicKeyToken=594a0605db190bb9' en el contexto 'Default'
            // en la ubicación 'C:\Users\xxx\AppData\Local\Temp\Temporary ASP.NET Files\vs\8d828e81\123f78ff\assembly\dl3\aba2dd9a\c120ca07_d29cdc01\C1.C1Report.2.dll'.'
    
                // Detail section height = 0 (no detail rows rendered separately)
                if (report.Sections.Contains("Detail"))
                    report.Sections["Detail"].Height = 0;
    // Debe ir al principio del archivo, antes de cualquier using
    extern alias c1v48;
    
    using Aleatica.Sep.WebApp.Controls.Reporting;
    using C1.Web.Wijmo.Controls.C1ReportViewer;
    using C1PreviewV48 = c1v48::C1.C1Preview;
    using C1ReportV48 = c1v48::C1.C1Report;        // la v4.8 via extern alias
    using CommonServices = Sep.Common.Service;
    var report = C1ReportViewer.CreateC1Report();

    better use ?

    var report = new C1ReportV48.C1Report();

    any help ?

  • Posted 13 July 2026, 4:13 am EST

    Hello Enrique,

    It looks like you are using different version of assemblies in your project. Please use only one version of C1 in your project.

    We have created a sample: Report_Sample.zip

    If you are not using different version, please modify the sample we attached to reproduce the error. Once we have a sample replicating the exact issue, we’ll investigate and assist you accordingly.

    Regards,

    Uttkarsh.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels