Posted 27 January 2026, 11:53 am EST - Updated 28 January 2026, 11:46 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>
Alternatives ?
NavigationBar-HasExportButton="True"
ImageRenderMethod="HttpHandler"
<NavigationBar Style-BackColor="Control"></NavigationBar>
if (!exportsXls)
C1WebReport.Export(C1.Web.C1WebReport.ExportFormatsEnum.PDF);
else
C1WebReport.Export(C1.Web.C1WebReport.ExportFormatsEnum.XLS);
How-to export report to XLSX, XLS, and PDF?
Now, not method Export.
I have see your C1ReportViewerChangeExportButtonBehavior product sample located at .\Documents\ComponentOne Samples\ASP.NET Web Forms\WebForms\CS\HowTo
Now, it’s very more complex.
using iframe:
<iframe id="customsaveframe" style="width:1px;height:1px;"></iframe>
using HttpHandler.ashx
What is IC1WebReportService ?
what is reportService.ExportToFile using documentKey ?
public void ProcessRequest(HttpContext context)
{
IC1WebReportService reportService = C1WebReportServiceHelper.MakeHelper((string)context.Request.Params["documentKey"]);
// Export report to a file:
string url = reportService.ExportToFile((string)context.Request.Params["documentKey"], context.Request.Params["exportFormat"]);
// Convert url to a file path:
string pathSource = url.Substring(url.IndexOf("tempReports"));
pathSource = context.Server.MapPath(pathSource);
Javascript:
what is
var docStatus = $(viewerSelector).c1reportviewer("option", "documentStatus");
what is docStatus.documentKey ?
function exportToFile() {
var viewerSelector = "#<%=C1ReportViewer1.ClientID%>";
var docStatus = $(viewerSelector).c1reportviewer("option", "documentStatus");
if (docStatus.isGenerating) {
alert("Can't export. Document is not yet generated.");
}
else {
document.getElementById("customsaveframe").src = "CustomSaveHttpHandler.ashx?documentKey=" + docStatus.documentKey + "&exportFormat=Open%20XML%20Excel&exportFormatExt=xlsx";
}
return false;
}
In aspx: Add own export button
protected void Page_Load(object sender, EventArgs e)
{
C1ReportViewerToolbar toolBar = C1ReportViewer1.ToolBar;
((HtmlGenericControl)toolBar.Controls[1]).Style["display"] = "none"; // hide original save(export) button
// Add own export button
HtmlGenericControl saveButton = new HtmlGenericControl("button");
saveButton.Attributes["title"] = "Custom export";
saveButton.Attributes["class"] = "custom-export";
saveButton.InnerHtml = "Custom Save";
toolBar.Controls.AddAt(1, saveButton);
}
not another alternative more simple ?
I want only export to XLS-PDF. (XLS legacy) but I want NOT C1ReportViewer visible.
My C1ReportViewer has
Visible="False
<cc1:C1ReportViewer ID="C1WebReport" runat="server" Visible="False" Height="287px"
FileName="EncuestasReport" >
</cc1:C1ReportViewer>
legacy code for export report:
C1WebReport.Visible = true;
C1WebReport.Width = 1;
C1WebReport.Height = 1;
How-to start the export , how-to call exportToFile javascript ?
Add own export button is required ?
how-to start generating report, using
.c1reportviewer("option", "documentStatus"); ?
added:
I get System.ArgumentException: ‘La ruta de acceso relativa virtual ‘_Reports/Temp/’ no se permite aquí.’
What is reportService.ashx in root WAP ? C1REport control code in execution time ?
//ver:[120921]
<%@ WebHandler Language="C#" Class="reportService" %>
using C1.Web.Wijmo.Controls;
using C1.Web.Wijmo.Controls.C1ReportViewer;
using C1.Web.Wijmo.Controls.C1ReportViewer.ReportService;
public class reportService : IHttpHandler, System.Web.SessionState.IRequiresSessionState
}
if (string.IsNullOrEmpty(reportsFolderPath))
{
reportsFolderPath = "~/tempReports";
}
reportService = new C1WebReportServiceHelper(inMemoryDoc,
reportCache,
extraOptions,
ViewType.PageImages,
HttpContext.Current.Server.MapPath(reportsFolderPath), VirtualPathUtility.ToAbsolute(reportsFolderPath));
Added 2:
System.Web.HttpException: ‘‘C:/TFS/Dev/Upgrade/Solucion/Projects/Web/WebApp/_Reports/Files/CollectionReports/Survey.xml’ es una ruta de acceso física, pero se esperaba una ruta de acceso virtual.’
private C1ReportV48.C1Report GetReport()
{
//var report = new C1Report();
//see https://developer.mescius.com/componentone/docs/webforms/online-reportviewer/NoteonC1ReportC1PrintDocumentLicensing.html
var report = C1ReportViewer.CreateC1Report();
var reportPath = string.Format("{0}/{1}/CollectionReports/Survey.xml", HttpContext.Current.Request.PhysicalApplicationPath, GenericService.Instance.GetConfigurationParameter(ConfigurationParamType.ReportsPath));
report.Load(Server.MapPath(reportPath), "EncuestasReport");









