ReportViewerBase
Definition
Namespace:Telerik.ReportViewer.WinForms
Assembly:Telerik.ReportViewer.WinForms.dll
Syntax:
[Docking(DockingBehavior.AutoDock)]
public abstract class ReportViewerBase : UserControl
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlContainerControlUserControlReportViewerBase...
Derived Classes:
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. 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
public bool AllowNavigatingToFileUrls { get; set; }
CurrentPage
int
Gets or sets the current page in the viewer.
[Browsable(false)]
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; }
Default value: false
Determines if navigate back in report viewer history operation is enabled
[Browsable(false)]
public bool NavigateBackEnabled { get; }
Determines if navigate forward in report viewer history operation is enabled
[Browsable(false)]
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; }
Gets the current processing state of the viewer
[Browsable(false)]
public ProcessingState ProcessingState { get; }
RenderingExtensions
IEnumerable<RenderingExtension>
Gets the available rendering extensions list.
[Browsable(false)]
public IEnumerable<RenderingExtension> RenderingExtensions { get; }
Gets or sets the report displayed in the viewer.
[Browsable(false)]
[Obsolete("Telerik.ReportViewer.WinForms.ReportViewer.Report is now obsolete. Please use the Telerik.ReportViewer.WinForms.ReportViewer.ReportSource property instead. For more information, please visit: https://www.telerik.com/support/kb/reporting/general/q2-2012-api-changes-reportsources.aspx#winformsviewer.")]
public IReportDocument Report { get; set; }
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. Set this property in order to change the report shown in the viewer. The RefreshReport() method must be called in order to invoke the actual report change in the viewer.
public ReportSource ReportSource { get; set; }
Gets the ReportViewerModel instance.
public IReportViewerModel ReportViewerModel { get; }
[TypeConverter(typeof(ExpandableObjectConverter))]
public Resources Resources { 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; }
Enabling search will notify the report engine to produce search metadata while rendering the report. This metadata is used by the report viewer in search dialog and in the report viewer area for highlighting the found and selected items. Default value: false
Indicates whether DocumentMap button should be visible.
public bool ShowDocumentMapButton { get; set; }
ShowExportButton
bool
Indicates whether Export button should be visible.
public bool ShowExportButton { get; set; }
Indicates whether the history (Back, Forward) buttons should be visible.
public bool ShowHistoryButtons { get; set; }
Indicates whether the page navigation controls are visible.
public bool ShowPageNavigationControls { get; set; }
ShowPageSetup
bool
Indicates whether PageSetup button should be visible.
[Obsolete("Use ReportViewerBase.ShowPageSetupButton property instead.")]
[Browsable(false)]
public bool ShowPageSetup { get; set; }
Indicates whether PageSetup button should be visible.
public bool ShowPageSetupButton { get; set; }
Indicates whether Parameters button should be visible.
public bool ShowParametersButton { get; set; }
ShowPrintButton
bool
Indicates whether Print button should be visible.
public bool ShowPrintButton { get; set; }
Indicates whether PrintPreview button should be visible.
public bool ShowPrintPreviewButton { get; set; }
ShowProgress
bool
Indicates whether progress animation should be displayed while the report is rendered.
public bool ShowProgress { get; set; }
Indicates whether the Refresh button should be visible.
public bool ShowRefreshButton { get; set; }
ShowSearchButton
bool
Indicates whether Search button should be visible.
public bool ShowSearchButton { get; set; }
If the button is visible, it will set the viewer's EnableSearch property to true, when pressed.
ShowStopButton
bool
Indicates whether the Stop button should be visible.
public bool ShowStopButton { get; set; }
ShowZoom
bool
Indicates whether the Zoom input box should be visible.
public bool ShowZoom { get; set; }
ToolbarVisible
bool
Indicates whether the toolbar should be visible on the viewer.
public bool ToolbarVisible { 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; }
ZoomPercent
int
Gets or sets the percentage of zoom used for the report display.
public int ZoomPercent { get; set; }
Methods
protected virtual void AddToRenderingContext(IDictionary renderingContext)
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.WinForms.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()
Use this method to remove all viewer history records generated:
- From RefreshReport() method after the ReportSource property is changed.
- From Preview() method with different parameter values.
- From NavigateToReportAction interactivity action.
All history records including for the currently shown ReportSource are deleted.
protected override void Dispose(bool disposing)
Overrides:
Exports the report in the specified format.
public void ExportReport(string format, Hashtable deviceInfo)
Export format
deviceInfoHashtableContains parameters to pass to the rendering extension.
protected string FormatNavigateToFileConfirmation(string url)
string
virtual for test purposes only.
protected virtual void HandleNavigateToFileActionNotSupported(NotSupportedException nsx)
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.
Raises the Error event.
protected virtual void OnError(ErrorEventArgs e)
The ErrorEventArgs 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)
The ExportBeginEventArgs 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)
The ExportEndEventArgs 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)
The InteractiveActionEventArgs that contains the event data.
Raises the InteractiveActionExecuting event.
protected virtual void OnInteractiveActionExecuting(InteractiveActionCancelEventArgs e)
The InteractiveActionCancelEventArgs 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)
The InteractiveActionEventArgs that contains the event data.
protected override void OnLoad(EventArgs e)
Overrides:
Raises the Print event.
[Obsolete("OnPrint method is now obsolete. Please use Telerik.ReportViewer.WinForms.ReportViewer.OnPrintBegin method instead.")]
protected virtual void OnPrint(CancelEventArgs e)
The CancelEventArgs that contains the event data.
Raises the Print event.
[Obsolete("This overload is now obsolete. Please use Telerik.ReportViewer.WinForms.ReportViewer.OnPrintBegin(PrintBeginEventArgs) instead.")]
protected virtual void OnPrintBegin(CancelEventArgs e)
The CancelEventArgs that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the Print event.
protected virtual void OnPrintBegin(PrintBeginEventArgs e)
The PrintBeginEventArgs 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.WinForms.ReportViewer.OnPrintEnd(PrintEndEventArgs) instead.")]
protected virtual void OnPrintEnd(EventArgs e)
The EventArgs 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)
The PrintEndEventArgs that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the RenderingBegin event.
[Obsolete("This overload is now obsolete. Please use Telerik.ReportViewer.WinForms.ReportViewer.OnRenderingBegin(RenderingBeginEventArgs) instead.")]
protected virtual void OnRenderingBegin(CancelEventArgs e)
The CancelEventArgs 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)
The RenderingBeginEventArgs 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.WinForms.ReportViewer.OnRenderingEnd(RenderingEndEventArgs) instead.")]
protected virtual void OnRenderingEnd(EventArgs e)
The EventArgs 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)
The RenderingEndEventArgs that contains the event data.
When overridden, make sure you call the base method implementation.
Raises the ViewerToolTipOpening event.
protected virtual void OnToolTipExecuting(ToolTipOpeningEventArgs e)
The ToolTipOpeningEventArgs that contains the event data.
Raises the UpdateUI event.
protected virtual void OnUpdateUI(EventArgs e)
The EventArgs that contains the event data.
When overridden, make sure you call the base method implementation.
Renders the report in the viewer passing the currently entered parameter values to the report.
public void Preview()
Opens the print dialog for the report
public void PrintReport()
protected void PrintReportInternal(Hashtable deviceInfo, PrintBeginEventArgs eventArgs)
Capture the keystrokes to determine if a valid accessible area shortcut is pressed
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
bool
Overrides:
Loads and refreshes the ReportSource in the viewer.
Use this method to display in the viewer the report source
from the ReportSource property.
Fresh report data is pulled from the report source data sources.
Adds new history record in the report history right
after the current record and the new record becomes current.
This method should not be called before the Form.Load() event is fired
(avoid using it in the Form's constructor).
public void RefreshReport()
Resets the control to its default values.
public void Reset()
ShowNavigateToFileConfirmationDialog(string)
DialogResult
protected virtual DialogResult ShowNavigateToFileConfirmationDialog(string url)
DialogResult
Opens the page setup dialog
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 the EnableAccessibility property is changed.
public event AccessibilityChangedEventHandler AccessibilityChanged
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
CancelEventHandler
Occurs when the report in the viewer control is printed.
[Obsolete("Print event is now obsolete. Please use Telerik.ReportViewer.WinForms.ReportViewer.PrintBegin event instead.")]
public event CancelEventHandler Print
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
ViewerAreaPaint
PaintEventHandler
Occurs when the viewer's area is painted.
public event PaintEventHandler ViewerAreaPaint
Occurs when the tooltip, associated with a report item, is being opened
public event ToolTipOpeningEventHandler ViewerToolTipOpening