Task-Based Help / Enabling Error Handling in ReportViewer
Enabling Error Handling in ReportViewer

The C1ReportViewer control allows you to display built-in log console at run time for debugging purposes. The EnableLogs property enables the built-in log console.

In the following examples you'll set the EnableLogs property to True in order to display log console. You'll also set the FileName and ReportName to names that are not included so that an error is displayed in the log.

In Source View

In Source view add AutoPlay="True" ShowTimer="True" to the <cc1:C1ReportViewer> tag so it appears similar to the following:

To write code in  Source View

<cc1:c1reportviewer id="C1ReportViewer1" runat="server" filename="WrongReport.xml" reportname="WrongReportName" enablelogs="true">

At Design Time

In Design view, select the C1ReportViewer control and in the Properties window set the following:

In Code

Add the following code to the Page_Load event:

To write code in Visual Basic

Visual Basic
Copy Code
Me.C1ReportViewer1.FileName = "WrongReport.xml"
Me.C1ReportViewer1.ReportName = "WrongReportName"
Me.C1ReportViewer1.EnableLogs = True

To write code in C#

C#
Copy Code
this.C1ReportViewer1.FileName = "WrongReport.xml";
this.C1ReportViewer1.ReportName = "WrongReportName";
this.C1ReportViewer1.EnableLogs = true;

This Topic Illustrates

Run your application and observe that an error message appears:

C1ReportViewer