C1WebReport 2010v1 to C1ReportViewer 2025v2 399

Posted by: enrique.pv-ext on 22 January 2026, 11:53 am EST

    • Post Options:
    • Link

    Posted 22 January 2026, 11:53 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

    
                            <asp:LinkButton ID="btnExport" Visible="true" runat="server" OnClick="btnExport_Click">
                                <asp:Label ID="lblExport" runat="server" CssClass="XLS"></asp:Label>
                            </asp:LinkButton>
                              <asp:LinkButton ID="btnExportPDF" Visible="true" runat="server" OnClick="btnExportPDF_Click">
                                <asp:Label ID="lblExportPDF" runat="server" CssClass="PDF"></asp:Label>
                            </asp:LinkButton>
    
                    <cc9:C1WebReport ID="C1WebReport" runat="server"
                        Visible="False" Height="287px"
                        NavigationBar-HasExportButton="True"
                        ImageRenderMethod="HttpHandler">
                        <NavigationBar Style-BackColor="Control"></NavigationBar>
                    </cc9:C1WebReport>

    How-to use XLSX, not XLS, and PDF?

      public void showReport(bool exportsXls = true)
      {
          DataTable mainTable = _dataSources.Tables["MAIN_TABLE_USERS_CONFIGURATOR"];
          using (IReportsService reportService = new ReportsService())
          {
              ReportHelper.ExportUsersDetail(C1WebReport, reportService, LoggedUser, mainTable, exportsXls);
          }
          UpdatePanelReport.Update();
    
      }

    Whats about for new ReportView:

    • ReportSource for xml file ?

      Report.Fields?

      Report.C1Document.PageLayout.PageSettings

      Report.DataSource.Recordset?

      report.ExportFolder =

      report.Export(ExportFormatsEnum.PDF);

      report.Export(ExportFormatsEnum.XLS);
        public static void ExportUsersDetail(C1WebReport report, IReportsService reportService, SepUser loggedUser, DataTable users, bool exportXls)
        {
            try
            {
                report.ReportSource.FileName = string.Format("{0}/{1}/Configuration/UsersExport.xml",
                    HttpContext.Current.Request.PhysicalApplicationPath,
                    GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.ReportsPath));
    
                report.ReportSource.ReportName = "report";
    
                report.Report.Fields["logo"].Picture = string.Format("{0}/{1}",
                    HttpContext.Current.Request.PhysicalApplicationPath,
                    GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.LogoPath));
                report.Report.Fields["logo"].PictureScale = C1.C1Report.PictureScaleEnum.Scale;
    
                report.Report.C1Document.PageLayout.PageSettings.TopMargin = new Unit(Convert.ToDouble(GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.ReportsTopMargin)), UnitTypeEnum.Mm);
                report.Report.C1Document.PageLayout.PageSettings.BottomMargin = new Unit(Convert.ToDouble(GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.ReportsBottomMargin)), UnitTypeEnum.Mm);
                report.Report.C1Document.PageLayout.PageSettings.LeftMargin = new Unit(Convert.ToDouble(GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.ReportsLeftMargin)), UnitTypeEnum.Mm);
                report.Report.C1Document.PageLayout.PageSettings.RightMargin = new Unit(Convert.ToDouble(GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.ReportsRightMargin)), UnitTypeEnum.Mm);
                report.Report.C1Document.PageLayout.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A4;
    
                report.Report.Fields["lblLoggedUser"].Text = loggedUser.Name;
                report.Report.Fields["lblParamFechaHora"].Text = string.Format("{0:dd/MM/yyyy HH:mm:ss }", DateTime.Now);
    
                report.Report.DataSource.Recordset = users;
    
                var countActivos = users.AsEnumerable().Count(r=> r.Field<int>("STATUS_ID") == 1);
                var countInactivos = users.AsEnumerable().Count(r => r.Field<int>("STATUS_ID") == 0);
                report.Report.Fields["lblUserActivo"].Text = countActivos.ToString();
                report.Report.Fields["lblUserInactivos"].Text = countInactivos.ToString();
    
                #region Export report
                report.Visible = true;
                report.Width = 1;
                report.Height = 1;
    
                DirectoryInfo di = new DirectoryInfo(string.Format("{0}/{1}",
                    HttpContext.Current.Request.PhysicalApplicationPath,
                    GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.ReportsTemp)));
    
                if (!di.Exists)
                {
                    di.Create();
                }
                report.ExportFolder = GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.ReportsTemp);
                if (!exportXls)
                    report.Export(ExportFormatsEnum.PDF);
                else
                    report.Export(ExportFormatsEnum.XLS);
    
                #endregion
    
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message);
            }
          }
  • Posted 23 January 2026, 7:15 am EST

    Hello,

    To see how to export report to XLSX or PDF file, please refer to our C1ReportViewerChangeExportButtonBehavior product sample located at .\Documents\ComponentOne Samples\ASP.NET Web Forms\WebForms\CS\HowTo on your machine.

    To see how to load reports dynamically, please refer to https://developer.mescius.com/componentone/docs/webforms/online-reportviewer/AddDynamicReports.html and our product sample: InMemoryDocuments.aspx in ControlExplorer located at .\Documents\ComponentOne Samples\ASP.NET Web Forms\WebForms\CS on your machine.

    We have also shared a simple sample with you on the following thread: https://developer.mescius.com/forums/wijmo/issuesmigrate-from-2010v1-to-2025v1-webreport-gridview-event-handlers#84801

    Please note that, these samples will only be available if you have installed samples while installing the WebForms Suite using ComponentOneControlPanel.

    Please let us know if you face any issues during implementation.

    Regards,

    Uttkarsh.

Need extra support?

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

Learn More

Forum Channels