New to Telerik ReportingStart a free 30-day trial

Represents the WPF ReportViewer control.

Definition

Namespace:Telerik.ReportViewer.Wpf

Assembly:Telerik.ReportViewer.Wpf.dll

Syntax:

C#
[TemplatePart(Name = "PageScrollViewer", Type = typeof(ScrollViewer))]
[TemplatePart(Name = "PageContainer", Type = typeof(ContentControl))]
[TemplatePart(Name = "LayoutRoot", Type = typeof(FrameworkElement))]
public class ReportViewer : Control

Inheritance: objectDispatcherObjectDependencyObjectVisualUIElementFrameworkElementControlReportViewer...

Constructors

Initializes a new instance of the ReportViewer class.

C#
public ReportViewer()

Fields

Defines the AllowNavigatingToFileUrls property

C#
public static readonly DependencyProperty AllowNavigatingToFileUrlsProperty

AutoDisposeModelProperty

DependencyProperty

Defines the AutoDisposeModel property

C#
public static readonly DependencyProperty AutoDisposeModelProperty

CornerRadiusProperty

DependencyProperty

DependencyProperty for CornerRadius property.

C#
public static readonly DependencyProperty CornerRadiusProperty

EnableAccessibilityProperty

DependencyProperty

Defines the EnableAccessibility property

C#
public static readonly DependencyProperty EnableAccessibilityProperty

Defines the ReportEngineConnection property

C#
public static readonly DependencyProperty ReportEngineConnectionProperty

ReportSourceProperty

DependencyProperty

Defines the ReportSource dependency property.

C#
public static readonly DependencyProperty ReportSourceProperty
Remarks:

The property uses TwoWay binding mode by default, hence setting another mode might not update the target.

Defines the SearchMetadataOnDemand property

C#
public static readonly DependencyProperty SearchMetadataOnDemandProperty

TextResourcesProperty

DependencyProperty

Defines the TextResources property.

C#
public static readonly DependencyProperty TextResourcesProperty

ViewModeProperty

DependencyProperty

Defines the ViewMode property.

C#
public static readonly DependencyProperty ViewModeProperty
Remarks:

The property uses TwoWay binding mode by default, hence setting another mode might not update the target.

ZoomModeProperty

DependencyProperty

Defines the ZoomMode property.

C#
public static readonly DependencyProperty ZoomModeProperty

ZoomPercentProperty

DependencyProperty

Defines the ZoomPercent property.

C#
public static readonly DependencyProperty ZoomPercentProperty

Properties

Gets or sets the accessibility key shortcuts map, used when the report viewer is in accessible mode. Returns null reference if the viewer's accessibility is not enabled.

C#
[Browsable(false)]
public Dictionary<int, ShortcutKeys> AccessibilityKeyMap { get; set; }

Gets or sets a value that determines whether the execution of NavigateToURL action that points to a file is allowed.

C#
public bool AllowNavigatingToFileUrls { get; set; }
Remarks:

If set to false, navigating to local or network file from NavigateToUrl action will be disabled. If set to true, navigating to local or network file from NavigateToUrl action will show a confirmation window before executing the action. Default value: false

Gets or sets a value that indicates if the report viewer model and its resources will be automatically disposed when the window is closed.

C#
public bool AutoDisposeModel { get; set; }

CornerRadius

CornerRadius

The CornerRadius property allows users to control the roundness of the corners independently by setting a radius value for each corner. Radius values that are too large are scaled so that they smoothly blend from corner to corner.

C#
public CornerRadius CornerRadius { get; set; }

Gets or sets the current page in the viewer.

C#
public int CurrentPage { get; set; }

Gets or sets a value that indicates whether the document map is displayed if any bookmark is defined.

C#
public bool DocumentMapVisible { get; set; }

Gets or sets a value that indicates whether the accessibility features of the report viewer and its contents should be enabled.

C#
public bool EnableAccessibility { get; set; }

Determines if navigate back in report viewer history operation is enabled

C#
public bool NavigateBackEnabled { get; }

Determines if navigate forward in report viewer history operation is enabled

C#
public bool NavigateForwardEnabled { get; }

Gets or sets a value that indicates whether the parameters area is displayed if any parameter editor exists.

C#
public bool ParametersAreaVisible { get; set; }

Gets the available rendering extensions list.

C#
[Browsable(false)]
public IEnumerable<RenderingExtension> RenderingExtensions { get; }

The connection string used to configure the reporting engine that will process and render the reports.

C#
public string ReportEngineConnection { get; set; }
Remarks:

If the selected engine is of remote type (REST Service or Report Server), the following extra dependencies are required:

  • Telerik.Reporting.Services.HttpClient
  • System.Net.Http
  • System.Net.Http.Formatting

Note: Connecting to Report Server for .NET is not supported yet.

Gets or sets the ReportSource for the report displayed in the viewer.

C#
public ReportSource ReportSource { get; set; }

Gets the ReportViewerModel instance.

C#
public IReportViewerModel ReportViewerModel { get; }

Gets or sets a value that indicates whether the search metadata will be delivered on demand or by default.

C#
public bool SearchMetadataOnDemand { get; set; }

Gets or sets the tooltips and the messages of the control.

C#
[TypeConverter(typeof(ExpandableObjectConverter))]
public ITextResources TextResources { get; set; }

Gets the count of the available pages in the viewer.

C#
[Browsable(false)]
public int TotalPages { get; }

Specifies whether the viewer is in interactive or print preview mode.

C#
public ViewMode ViewMode { get; set; }

Gets or sets the zoom mode of the control.

C#
[TypeConverter(typeof(ZoomModeConverter))]
public ZoomMode ZoomMode { get; set; }

Gets or sets the zoom percentage to use when displaying the report.

C#
public int ZoomPercent { get; set; }

Methods

Stops the background processing of the report.

C#
public void CancelRendering()

Stops background processing of the report.

C#
[Obsolete("CancelRendering(int timeout) method is now obsolete. Please use the Telerik.ReportViewer.Wpf.ReportViewer.CancelRendering() method instead.")]
public bool CancelRendering(int timeout)
Parameters:timeoutint

The number of milliseconds to wait for the background rendering to terminate. A value of -1 waits forever. A value of 0 returns immediately without waiting for the rendering to terminate.

Returns:

bool

A Boolean value. A value of true is returned if the background rendering has terminated. A value of false is returned if background rendering has not terminated after the amount of time specified in the millisecondsTimeout parameter has elapsed, or if the millisecondsTimeout parameter was set to 0.

Determines whether the viewer can be navigated to a specified page.

C#
public bool CanMoveToPage(int pageIndex)
Parameters:pageIndexint

The page number to determine navigation possibility.

Returns:

bool

Returns true if the viewer can be moved to the specified page.

Clears the report viewer navigation history.

C#
public void ClearHistory()

Displays the license information UI.

C#
public void DisplayLicenseUI(LicenseInfo licenseInfo, string productVersion)
Parameters:licenseInfoLicenseInfoproductVersionstring

Disposes the model and detaches its event handlers.

C#
public virtual void DisposeModel()

Detaches the event handlers from the owner window. Disposes the model and detaches its event handlers.

C#
public virtual void DisposeViewerResources()

Detaches the event handlers from the owner window. Disposes the model and detaches its event handlers.

C#
public virtual void DisposeViewerResources(object ownerWindow)
Parameters:ownerWindowobject

The owner window of the ReportViewer instance.

Exports the report in the specified format.

C#
public void ExportReport(string format, Hashtable deviceInfo)
Parameters:formatstring

Export format

deviceInfoHashtable

Contains parameters to pass to the rendering extension.

Instantiates and initializes the report viewer model.

C#
public void InitializeModel()

Navigates the viewer back one step in the navigation history.

C#
public void NavigateBack()
Remarks:

Check NavigateBackEnabled if this operation is enabled. If not, exception is thrown.
The ReportSource property will reflect the change in the currently shown report.

Navigates the viewer forward one step in the navigation history.

C#
public void NavigateForward()
Remarks:

Check NavigateForwardEnabled if this operation is enabled. If not, exception is thrown.
The ReportSource property will reflect the change in the currently shown report.

C#
public override void OnApplyTemplate()

Overrides: FrameworkElement.OnApplyTemplate()

Raises the Error event.

C#
protected virtual void OnError(ErrorEventArgs e)
Parameters:eErrorEventArgs

An ErrorEventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Raises the ExportBegin event.

C#
protected virtual void OnExportBegin(ExportBeginEventArgs e)
Parameters:eExportBeginEventArgs

An ExportBeginEventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Raises the ExportEnd event.

C#
protected virtual void OnExportEnd(ExportEndEventArgs e)
Parameters:eExportEndEventArgs

An ExportEndEventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Raises the InteractiveActionEnter event.

C#
protected virtual void OnInteractiveActionEnter(InteractiveActionEventArgs e)
Parameters:eInteractiveActionEventArgs

A InteractiveActionEventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Raises the InteractiveActionExecuting event.

C#
protected virtual void OnInteractiveActionExecuting(InteractiveActionCancelEventArgs e)
Parameters:eInteractiveActionCancelEventArgs

A InteractiveActionCancelEventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Raises the InteractiveActionLeave event.

C#
protected virtual void OnInteractiveActionLeave(InteractiveActionEventArgs e)
Parameters:eInteractiveActionEventArgs

A InteractiveActionEventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Raises the PrintBegin event.

C#
[Obsolete("This overload is now obsolete. Please use Telerik.ReportViewer.Wpf.ReportViewer.OnPrintBegin(PrintBeginEventArgs) instead.")]
protected virtual void OnPrintBegin(CancelEventArgs e)
Parameters:eCancelEventArgs

An CancelEventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Raises the PrintBegin event.

C#
protected virtual void OnPrintBegin(PrintBeginEventArgs e)
Parameters:ePrintBeginEventArgs

An CancelEventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Raises the PrintEnd event.

C#
[Obsolete("This overload is now obsolete. Please use Telerik.ReportViewer.Wpf.ReportViewer.OnPrintEnd(PrintEndEventArgs) instead.")]
protected virtual void OnPrintEnd(EventArgs e)
Parameters:eEventArgs

An EventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Raises the PrintEnd event.

C#
protected virtual void OnPrintEnd(PrintEndEventArgs e)
Parameters:ePrintEndEventArgs

An EventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

C#
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters:eDependencyPropertyChangedEventArgs

Overrides: FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)

Raises the RenderingBegin event.

C#
[Obsolete("This overload is now obsolete. Please use Telerik.ReportViewer.Wpf.ReportViewer.OnRenderingBegin(RenderingBeginEventArgs) instead.")]
protected virtual void OnRenderingBegin(CancelEventArgs e)
Parameters:eCancelEventArgs

An CancelEventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Raises the RenderingBegin event.

C#
protected virtual void OnRenderingBegin(RenderingBeginEventArgs e)
Parameters:eRenderingBeginEventArgs

An CancelEventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Raises the RenderingEnd event.

C#
[Obsolete("This overload is now obsolete. Please use Telerik.ReportViewer.Wpf.ReportViewer.OnRenderingEnd(RenderingEndEventArgs) instead.")]
protected virtual void OnRenderingEnd(EventArgs e)
Parameters:eEventArgs

An EventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Raises the RenderingEnd event.

C#
protected virtual void OnRenderingEnd(RenderingEndEventArgs e)
Parameters:eRenderingEndEventArgs

An EventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Occurs when the tooltip, associated with a report item, is being shown

C#
protected virtual void OnToolTipOpening(ToolTipOpeningEventArgs e)
Parameters:eToolTipOpeningEventArgs

Raises the UpdateUI event.

C#
protected virtual void OnUpdateUI(EventArgs e)
Parameters:eEventArgs

An EventArgs object that contains the event data.

Remarks:

When overridden, make sure you call the base method implementation.

Opens the print dialog for the report

C#
public void PrintReport()

Refreshes the current report in the viewer. Last used parameter values are used.

C#
[Obsolete("RefreshData method is now obsolete. Please use RefreshReport instead.")]
public void RefreshData()

Refreshes the current report in the viewer. Last used parameter values are used.

C#
public void RefreshReport()

Opens the page setup dialog for the report

C#
public void ShowPageSetupDialog()

Toggles the search dialog to search within the document. If the search metadata is not prepared, invokes report refresh to generate the search metadata and then opens the dialog.

C#
public void ToggleReportContentSearch()

Events

Occurs when there is an error in the report viewer control.

C#
public event ErrorEventHandler Error

Occurs when the report in the viewer control starts exporting.

C#
public event ExportBeginEventHandler ExportBegin
Remarks:

Can be used to modify device info settings, such as report culture, before the export starts

Occurs when the report exporting in the viewer control is finished.

C#
public event ExportEndEventHandler ExportEnd

Occurs when the mouse cursor enters the area of a report item's action.

C#
public event InteractiveActionEnterEventHandler InteractiveActionEnter

Occurs when an action is being executed. Execution can be canceled.

C#
public event InteractiveActionExecutingEventHandler InteractiveActionExecuting

Occurs when the mouse cursor leaves the area of a report item's action.

C#
public event InteractiveActionLeaveEventHandler InteractiveActionLeave

Occurs when the report in the viewer control starts printing.

C#
public event PrintBeginEventHandler PrintBegin

Occurs when the report printing in the viewer control is finished.

C#
public event PrintEndEventHandler PrintEnd

Occurs when the report in the viewer control starts rendering.

C#
public event RenderingBeginEventHandler RenderingBegin
Remarks:

Can be used to modify device info settings, such as report culture, before the rendering starts

Occurs when the report rendering in the viewer control is finished.

C#
public event RenderingEndEventHandler RenderingEnd

UpdateUI

EventHandler

Occurs when the UI of the report viewer control is updated.

C#
public event EventHandler UpdateUI

Occurs when the tooltip, associated with a report item, is being opened

C#
public event ToolTipOpeningEventHandler ViewerToolTipOpening
In this article
DefinitionConstructorsReportViewer()FieldsAllowNavigatingToFileUrlsPropertyAutoDisposeModelPropertyCornerRadiusPropertyEnableAccessibilityPropertyReportEngineConnectionPropertyReportSourcePropertySearchMetadataOnDemandPropertyTextResourcesPropertyViewModePropertyZoomModePropertyZoomPercentPropertyPropertiesAccessibilityKeyMapAllowNavigatingToFileUrlsAutoDisposeModelCornerRadiusCurrentPageDocumentMapVisibleEnableAccessibilityNavigateBackEnabledNavigateForwardEnabledParametersAreaVisibleRenderingExtensionsReportEngineConnectionReportSourceReportViewerModelSearchMetadataOnDemandTextResourcesTotalPagesViewModeZoomModeZoomPercentMethodsCanMoveToPage(int)CancelRendering()CancelRendering(int)ClearHistory()DisplayLicenseUI(LicenseInfo, string)DisposeModel()DisposeViewerResources()DisposeViewerResources(object)ExportReport(string, Hashtable)InitializeModel()NavigateBack()NavigateForward()OnApplyTemplate()OnError(ErrorEventArgs)OnExportBegin(ExportBeginEventArgs)OnExportEnd(ExportEndEventArgs)OnInteractiveActionEnter(InteractiveActionEventArgs)OnInteractiveActionExecuting(InteractiveActionCancelEventArgs)OnInteractiveActionLeave(InteractiveActionEventArgs)OnPrintBegin(CancelEventArgs)OnPrintBegin(PrintBeginEventArgs)OnPrintEnd(EventArgs)OnPrintEnd(PrintEndEventArgs)OnPropertyChanged(DependencyPropertyChangedEventArgs)OnRenderingBegin(CancelEventArgs)OnRenderingBegin(RenderingBeginEventArgs)OnRenderingEnd(EventArgs)OnRenderingEnd(RenderingEndEventArgs)OnToolTipOpening(ToolTipOpeningEventArgs)OnUpdateUI(EventArgs)PrintReport()RefreshData()RefreshReport()ShowPageSetupDialog()ToggleReportContentSearch()EventsErrorExportBeginExportEndInteractiveActionEnterInteractiveActionExecutingInteractiveActionLeavePrintBeginPrintEndRenderingBeginRenderingEndUpdateUIViewerToolTipOpening
Not finding the help you need?
Contact Support