C1ReportViewer in C1Dialog 2025v2 399 - Gridview RowCommand UpdatePanels

Posted by: enrique.pv-ext on 24 March 2026, 7:52 am EST

  • Posted 24 March 2026, 7:52 am EST - Updated 24 March 2026, 7:57 am EST

    Hi,

    Migrate from 2010v1 to 2025v2 399 in ASP.NET WebForms NET Framework 4.8.1.

    Using C1ReportViewer from C1.Web.Wijmo.Controls.48.dll

    Changes C1WebReport to C1ReportViewer control.

    We try this approach: C1ReportViewer control (viewer mode) in a C1Dialog, in aspx with UpdatePanels, GridView (RowCommand), …

    I have GridView in UpdatePanel, any row has RowCommand:

    <asp:UpdatePanel ID="UpdatePanelGrid" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                    <div id="DivSubTitleShifts">
                        <h2 class='subtitle' id="SubTitle" runat="server"></h2>
                    </div>
    
                    <cc1:C1GridView ID="C1GridView1" Width="100%" Visible="true"
                        DataKeyNames="...."
                        runat="server"
                        ScrollSettings-ScrollMode="None"
                        AllowPaging="True" PageSize="26"
                        AllowSorting="True" ShowFilter="True"
                        AutogenerateColumns="False"
                        OnPageIndexChanging="C1GridView1_PageIndexChanging"
                        OnSorting="C1GridView1_Sorting"
                        OnSorted="C1GridView1_Sorted"
                        OnFiltering="C1GridView1_Filtering"
                        OnRowCreated="C1GridView1_RowCreated"
                        OnRowCommand="C1GridView1_RowCommand"
                        OnRowDataBound="C1GridView1_RowDataBound">
                        <Columns>
                        </Columns>
                    </cc1:C1GridView>
                </ContentTemplate>
            </asp:UpdatePanel>

    RowCommand:

            protected void C1GridView1_RowCommand(object sender, C1GridViewCommandEventArgs e)
            {
                if (e.CommandName == "ShowReport")
                {
                    int index = int.Parse((string)e.CommandArgument);
                    C1GridView1.SelectedIndex = index;
    				
    				// ...
    
                    // ===============================
                    // 3. Refrescar Grid como antes
                    // ===============================
                    DataTable dt;
    				// ...
    				dt = ...
    				
                    C1GridView1.DataSource = HelperUtil.GetGridFilterByFieldType(C1GridView1.Columns, dt, .., null);
                    reStartGridFieldsAndBind();
    
                    //this.C1GridView1.DataSource = dt;
                    //this.C1GridView1.DataBind();
                    UpdatePanelGrid.Update();
    
                }
                else if (e.CommandName == "GoToLiquidation")
                {

    C1ReportViewer:

    <cc1:C1ReportViewer ID="ReportViewer" runat="server" 
    				ReportsFolderPath="~/_Reports/Temp"
    				Width="850px" Height="650px"
    				Zoom="100%"
    				ReportName="report"
    				EnableLogs="false" CollapseToolsPanel="True" />

    BuildReport

        public static C1ReportV48.C1Report BuildReport(int Id, ....)
        {
                IReportsService rptService = new ReportConmexService();
    
                var report = C1ReportViewer.CreateC1Report();
                var path = $"{HttpContext.Current.Request.PhysicalApplicationPath}/ReportsPath/CollectionReports.xml";
                report.Load(Path.GetFullPath(path), "report");
                report.ReportName = "report";
    
                // === Logo ===
                report.Fields["logo"].Picture = ...
                report.Fields["logo"].PictureScale = C1ReportV48.PictureScaleEnum.Scale;
    
    			// ...
                report.Fields["lblParamFechaHoraLF"].Text = header.Rows[0]["DATE_TIME"].ToString();
                report.Fields["lblParamPlace"].Text = header.Rows[0]["PLACE"].ToString();
    
                // === Page layout ===
                var settings = report.C1Document.PageLayout.PageSettings;
    
                settings.TopMargin = new c1v48::C1.C1Preview.Unit(Convert.ToDouble(GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.ReportsTopMargin)), c1v48::C1.C1Preview.UnitTypeEnum.Mm);
                settings.BottomMargin = new c1v48::C1.C1Preview.Unit(Convert.ToDouble(GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.ReportsBottomMargin)), c1v48::C1.C1Preview.UnitTypeEnum.Mm);
                settings.LeftMargin = new c1v48::C1.C1Preview.Unit(Convert.ToDouble(GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.ReportsLeftMargin)), c1v48::C1.C1Preview.UnitTypeEnum.Mm);
                settings.RightMargin = new c1v48::C1.C1Preview.Unit(Convert.ToDouble(GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.ReportsRightMargin)), c1v48::C1.C1Preview.UnitTypeEnum.Mm);
    
                settings.PaperKind = System.Drawing.Printing.PaperKind.A4;
    
                // === MAIN DATASOURCE ===
                report.DataSource.Recordset = dvShift;
    
                return report;

    Can I use C1ReportViewer in a C1Dialog ?

    In RowCommand, can be show a C1Dialog, that contains a C1ReportViewer visible ?

    The user view the report, and can select export to pdf or excel

    Any suggestions ?

  • Posted 24 March 2026, 12:08 pm EST

    I try:

      protected void C1GridView1_RowCommand(object sender, C1GridViewCommandEventArgs e)
      {
          if (e.CommandName == "ShowReport")
          {
              // ===============================
              // 1. Obtener claves del Grid
              // ===============================
              int index = int.Parse((string)e.CommandArgument);
              C1GridView1.SelectedIndex = index;
    
                    var shiftsToLiquidateList = service.GetShiftsToLiquidate(int.Parse(idFinalLiquidation), ...);
                    var report = ReportHelper.BuildFinalLiquidationReport(
                            int.Parse(idFinalLiquidation),
                            shiftsToLiquidateList,....);
    
    
                    // Enviar el archivo temporal al report viewer
                    string tempFolder = Server.MapPath("~/_Reports/Temp");
                    string fileReport = Path.Combine(tempFolder, "report.xml");
    
                    report.Save(fileReport);
                    //report.DataSource
    
                    var path = $"{HttpContext.Current.Request.PhysicalApplicationPath}/{GetConfigurationParameter(ConfigurationParamType.ReportsPath)}/CollectionReports/FinalLiquidation.xml";
    
                    //report.Load(Path.GetFullPath(path), "report");
                    //report.ReportName = "report";
    
                    C1ReportViewer.RegisterDocument("report", () => report);
    
                    ReportViewer.ReportName = "report";
                    ReportViewer.ReportsFolderPath = "~/_Reports/Temp";
                    //ReportViewer.FileName = "~/_Reports/Files/CollectionReports/FinalLiquidation.xml";
                    ReportViewer.FileName = "report";
                    ReportViewer.FullScreen = false;
                    ReportViewer.Zoom = "100%";
                    //ReportViewer.Zoom = "Fit Width";
    
                    // Mostrar el diálogo
                    ReportDialog.ShowOnLoad = true;
    
                    // ===============================
                    // 3. Refrescar Grid como antes
                    // ===============================
                    DataTable dt;
                
                        dt = ((DataView)service.GetMainTable(CurrentPlaceID, _loggedUser.LanguageId, dateA, dateB, -1)).Table;
    
                    C1GridView1.DataSource = HelperUtil.GetGridFilterByFieldType(C1GridView1.Columns, dt,  null);
                    reStartGridFieldsAndBind();
    
                    //this.C1GridView1.DataSource = dt;
                    //this.C1GridView1.DataBind();
                    UpdatePanelGrid.Update();
  • Posted 25 March 2026, 8:54 am EST

    Hello Enrique,

    We’re currently reviewing your cases and will get back to you as soon as we have updates.

    Regards,

    Uttkarsh.

  • Posted 26 March 2026, 2:34 am EST

    Hello Enrique,

    We were able to display ReportViewer using C1Dialog, however, the report does not load. We have shared our observations with the development team for further insights and will get back when we have more updates. [Internal Tracking ID: C1WEB-30440]

    Current sample: GridView_ReportViewer_Dialog_Sample.zip

    Regards,

    Uttkarsh.

  • Posted 26 March 2026, 3:15 am EST

    Hello Enrique,

    After investigating further, we were able to display the report in C1Dialog and export to PDF and Excel properly. Please refer to the attached updated sample: GridView_ReportViewer_Dialog_Sample_Mod.zip.

    Please note that, you’ll need to add references to C1.C1Report.4.8 from “C:\Program Files (x86)\MESCIUS\ComponentOne\ASP.NET Web Forms\bin\v4.8” path to the project and license entry for Excel in licenses.licx file:

    C1.Excel.C1XLBook, C1.Excel

    Please let us know if there are any further queries.

    Regards,

    Uttkarsh.

  • Posted 27 March 2026, 6:47 am EST

    I try and I get:

    Exception occurred creating type ‘C1.Excel.C1XLBook, C1.Excel, Version=9.0.20251.173, Culture=neutral, PublicKeyToken=6b66a9e217bdeae0’ System.UnauthorizedAccessException: The ComponentOne license key is invalid or missing.

    licenses.licx

    C1.Excel.C1XLBook, C1.Excel

    C1.Web.Wijmo.Controls.C1Accordion.C1Accordion, C1.Web.Wijmo.Controls.48

    C1.Web.Wijmo.Controls.C1AppView.C1AppView, C1.Web.Wijmo.Controls.48

    I have GridView_Pagination.gclicx too.

    any suggestions ?

  • Posted 30 March 2026, 6:21 am EST

    Hello Enrique,

    It seems you are using an older version (our sample uses latest version), could you please try removing the C1Excel license entry we mentioned earlier?

    C1.Excel.C1XLBook, C1.Excel

    If you still face issues, please share the following:

    • your *.csproj file
    • exact version of C1WebForms controls you use.
    • your licenses.licx and *.gclicx files

    Regards,

    Uttkarsh.

  • Posted 12 May 2026, 7:11 am EST

    Hello Enrique,

    Regarding C1WEB-30440, we escalated the issue related to the ReportViewer CSS not loading correctly. After further investigation, the team shared the following update:

    The layout distortion issue occurs specifically when ‘C1ReportViewer’ is hosted inside ‘C1Dialog’ and the dialog is opened after a partial postback, such as from a ‘GridView RowCommand’ inside an ‘UpdatePanel’.

    The ReportViewer renders correctly in the following scenarios:

    • When used standalone
    • When the dialog is opened during the initial page load

    However, when the dialog is triggered after a partial postback, the viewer layout becomes distorted. The team tested multiple workarounds, including removing ‘ShowOnLoad’, triggering resize operations, refreshing the viewer, and restructuring script execution timing, but the issue still persists.

    Based on the reproducible behavior and after ruling out integration-related causes, this appears to be a control-level issue related to initialization or measurement when the dialog container remains hidden during rendering.

    To track this issue, the team has logged the following bug: C1WEB-30505

    At the moment, we do not have an ETA for the fix. However, we will keep you updated once any progress is made or the issue is resolved.

    Regards,

    Uttkarsh

Need extra support?

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

Learn More

Forum Channels