ReportViewer
Represents the WPF ReportViewer control.
Definition
Namespace:Telerik.ReportViewer.Wpf
Assembly:Telerik.ReportViewer.Wpf.dll
Syntax:
[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.
public ReportViewer()
Fields
AllowNavigatingToFileUrlsProperty
DependencyProperty
Defines the AllowNavigatingToFileUrls property
public static readonly DependencyProperty AllowNavigatingToFileUrlsProperty
AutoDisposeModelProperty
DependencyProperty
Defines the AutoDisposeModel property
public static readonly DependencyProperty AutoDisposeModelProperty
CornerRadiusProperty
DependencyProperty
DependencyProperty for CornerRadius property.
public static readonly DependencyProperty CornerRadiusProperty
EnableAccessibilityProperty
DependencyProperty
Defines the EnableAccessibility property
public static readonly DependencyProperty EnableAccessibilityProperty
ReportEngineConnectionProperty
DependencyProperty
Defines the ReportEngineConnection property
public static readonly DependencyProperty ReportEngineConnectionProperty
ReportSourceProperty
DependencyProperty
Defines the ReportSource dependency property.
public static readonly DependencyProperty ReportSourceProperty
The property uses TwoWay binding mode by default, hence setting another mode might not update the target.
SearchMetadataOnDemandProperty
DependencyProperty
Defines the SearchMetadataOnDemand property
public static readonly DependencyProperty SearchMetadataOnDemandProperty
TextResourcesProperty
DependencyProperty
Defines the TextResources property.
public static readonly DependencyProperty TextResourcesProperty
ViewModeProperty
DependencyProperty
Defines the ViewMode property.
public static readonly DependencyProperty ViewModeProperty
The property uses TwoWay binding mode by default, hence setting another mode might not update the target.
ZoomModeProperty
DependencyProperty
Defines the ZoomMode property.
public static readonly DependencyProperty ZoomModeProperty
ZoomPercentProperty
DependencyProperty
Defines the ZoomPercent property.
public static readonly DependencyProperty ZoomPercentProperty
Properties
AccessibilityKeyMap
Dictionary<int, ShortcutKeys>
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.
[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.
public bool AllowNavigatingToFileUrls { get; set; }
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
AutoDisposeModel
bool
Gets or sets a value that indicates if the report viewer model and its resources will be automatically disposed when the window is closed.
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.
public CornerRadius CornerRadius { get; set; }
CurrentPage
int
Gets or sets the current page in the viewer.
public int CurrentPage { get; set; }
Gets or sets a value that indicates whether the document map is displayed if any bookmark is defined.
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.
public bool EnableAccessibility { get; set; }
Determines if navigate back in report viewer history operation is enabled
public bool NavigateBackEnabled { get; }
Determines if navigate forward in report viewer history operation is enabled
public bool NavigateForwardEnabled { get; }
Gets or sets a value that indicates whether the parameters area is displayed if any parameter editor exists.
public bool ParametersAreaVisible { get; set; }
RenderingExtensions
IEnumerable<RenderingExtension>
Gets the available rendering extensions list.
[Browsable(false)]
public IEnumerable<RenderingExtension> RenderingExtensions { get; }
ReportEngineConnection
string
The connection string used to configure the reporting engine that will process and render the reports.
public string ReportEngineConnection { get; set; }
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.
public ReportSource ReportSource { get; set; }
Gets the ReportViewerModel instance.
public IReportViewerModel ReportViewerModel { get; }
Gets or sets a value that indicates whether the search metadata will be delivered on demand or by default.
public bool SearchMetadataOnDemand { get; set; }
Gets or sets the tooltips and the messages of the control.
[TypeConverter(typeof(ExpandableObjectConverter))]
public ITextResources TextResources { get; set; }
TotalPages
int
Gets the count of the available pages in the viewer.
[Browsable(false)]
public int TotalPages { get; }
Specifies whether the viewer is in interactive or print preview mode.
public ViewMode ViewMode { get; set; }
Gets or sets the zoom mode of the control.
[TypeConverter(typeof(ZoomModeConverter))]
public ZoomMode ZoomMode { get; set; }
ZoomPercent
int
Gets or sets the zoom percentage to use when displaying the report.
public int ZoomPercent { get; set; }
Methods
Stops the background processing of the report.
public void CancelRendering()
Stops background processing of the report.
[Obsolete("CancelRendering(int timeout) method is now obsolete. Please use the Telerik.ReportViewer.Wpf.ReportViewer.CancelRendering() method instead.")]
public bool CancelRendering(int timeout)
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.
public bool CanMoveToPage(int pageIndex)
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.
public void ClearHistory()
Displays the license information UI.
public void DisplayLicenseUI(LicenseInfo licenseInfo, string productVersion)
Disposes the model and detaches its event handlers.
public virtual void DisposeModel()
Detaches the event handlers from the owner window. Disposes the model and detaches its event handlers.
public virtual void DisposeViewerResources()
Detaches the event handlers from the owner window. Disposes the model and detaches its event handlers.
public virtual void DisposeViewerResources(object ownerWindow)
The owner window of the ReportViewer instance.
Exports the report in the specified format.
public void ExportReport(string format, Hashtable deviceInfo)
Export format
deviceInfoHashtableContains parameters to pass to the rendering extension.
Instantiates and initializes the report viewer model.
public void InitializeModel()
Navigates the viewer back one step in the navigation history.
public void NavigateBack()
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.
public void NavigateForward()
Check NavigateForwardEnabled if this operation is enabled.
If not, exception is thrown.
The ReportSource property will reflect the change in the
currently shown report.
public override void OnApplyTemplate()
Overrides:
Raises the Error event.
protected virtual void OnError(ErrorEventArgs e)
An ErrorEventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the ExportBegin event.
protected virtual void OnExportBegin(ExportBeginEventArgs e)
An ExportBeginEventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the ExportEnd event.
protected virtual void OnExportEnd(ExportEndEventArgs e)
An ExportEndEventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the InteractiveActionEnter event.
protected virtual void OnInteractiveActionEnter(InteractiveActionEventArgs e)
A InteractiveActionEventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the InteractiveActionExecuting event.
protected virtual void OnInteractiveActionExecuting(InteractiveActionCancelEventArgs e)
A InteractiveActionCancelEventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the InteractiveActionLeave event.
protected virtual void OnInteractiveActionLeave(InteractiveActionEventArgs e)
A InteractiveActionEventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the PrintBegin event.
[Obsolete("This overload is now obsolete. Please use Telerik.ReportViewer.Wpf.ReportViewer.OnPrintBegin(PrintBeginEventArgs) instead.")]
protected virtual void OnPrintBegin(CancelEventArgs e)
An CancelEventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the PrintBegin event.
protected virtual void OnPrintBegin(PrintBeginEventArgs e)
An CancelEventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the PrintEnd event.
[Obsolete("This overload is now obsolete. Please use Telerik.ReportViewer.Wpf.ReportViewer.OnPrintEnd(PrintEndEventArgs) instead.")]
protected virtual void OnPrintEnd(EventArgs e)
An EventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the PrintEnd event.
protected virtual void OnPrintEnd(PrintEndEventArgs e)
An EventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Overrides:
Raises the RenderingBegin event.
[Obsolete("This overload is now obsolete. Please use Telerik.ReportViewer.Wpf.ReportViewer.OnRenderingBegin(RenderingBeginEventArgs) instead.")]
protected virtual void OnRenderingBegin(CancelEventArgs e)
An CancelEventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the RenderingBegin event.
protected virtual void OnRenderingBegin(RenderingBeginEventArgs e)
An CancelEventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the RenderingEnd event.
[Obsolete("This overload is now obsolete. Please use Telerik.ReportViewer.Wpf.ReportViewer.OnRenderingEnd(RenderingEndEventArgs) instead.")]
protected virtual void OnRenderingEnd(EventArgs e)
An EventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the RenderingEnd event.
protected virtual void OnRenderingEnd(RenderingEndEventArgs e)
An EventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Occurs when the tooltip, associated with a report item, is being shown
protected virtual void OnToolTipOpening(ToolTipOpeningEventArgs e)
Raises the UpdateUI event.
protected virtual void OnUpdateUI(EventArgs e)
An EventArgs object that contains the event data.
When overridden, make sure you call the base method implementation.
Opens the print dialog for the report
public void PrintReport()
Refreshes the current report in the viewer. Last used parameter values are used.
[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.
public void RefreshReport()
Opens the page setup dialog for the report
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.
public void ToggleReportContentSearch()
Events
Occurs when there is an error in the report viewer control.
public event ErrorEventHandler Error
Occurs when the report in the viewer control starts exporting.
public event ExportBeginEventHandler ExportBegin
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.
public event ExportEndEventHandler ExportEnd
Occurs when the mouse cursor enters the area of a report item's action.
public event InteractiveActionEnterEventHandler InteractiveActionEnter
Occurs when an action is being executed. Execution can be canceled.
public event InteractiveActionExecutingEventHandler InteractiveActionExecuting
Occurs when the mouse cursor leaves the area of a report item's action.
public event InteractiveActionLeaveEventHandler InteractiveActionLeave
Occurs when the report in the viewer control starts printing.
public event PrintBeginEventHandler PrintBegin
Occurs when the report printing in the viewer control is finished.
public event PrintEndEventHandler PrintEnd
Occurs when the report in the viewer control starts rendering.
public event RenderingBeginEventHandler RenderingBegin
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.
public event RenderingEndEventHandler RenderingEnd
UpdateUI
EventHandler
Occurs when the UI of the report viewer control is updated.
public event EventHandler UpdateUI
Occurs when the tooltip, associated with a report item, is being opened
public event ToolTipOpeningEventHandler ViewerToolTipOpening