[]
        
(Showing Draft Content)

GrapeCity.ActiveReports.Viewer.Win.Viewer

Viewer Class

Represents a Windows Forms user control designed to display ActiveReports report output. This control enables report readers to view and interact with the report content in various ways.

Namespace: GrapeCity.ActiveReports.Viewer.Win
Assembly: MESCIUS.ActiveReports.Viewer.Win.dll
Syntax
[ToolboxBitmap(typeof(Resources), "resources.Viewer.bmp")]
public class Viewer : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl
Remarks

The Viewer control offers a comprehensive set of features for interacting with reports, including:

  • Navigating through report pages.
  • Zooming in and out of the report content for better readability.
  • Printing reports directly from the viewer.
  • Exporting reports to different formats such as PDF, Excel, and Word.
  • Searching text within the report.
  • Interacting with report elements such as drill-through links and sorting.
It serves as a versatile component for applications that require report viewing and interaction capabilities.

Constructors

Name Description
Viewer()

Initializes a new instance of the Viewer class.

Properties

Name Description
AllowSplitter

Gets or sets a value indicating whether the viewer allows the view to be split into multiple panes.

AnnotationDropDownVisible

Gets or sets a value indicating whether the annotation dropdown is visible in the viewer.

AnnotationToolbarVisible

Gets or Sets the annotation toolbar's visibility.

AutoBackgroundColor

Gets or sets a value indicating whether the background color is automatically applied to the entire viewing area.

CanExport

Gets a value indicating whether exporting the report is permitted.

CurrentPage

Gets or sets the current page number displayed in the viewer.

Document

Gets or sets the document displayed in the viewer.

GalleyMode

Gets or sets a value indicating whether the viewer is in Galley Mode.

History

Provides access to the history management functionality of the viewer.

HyperlinkBackColor

Gets or sets the background color for hyperlink text areas within the report viewer. This setting applies only to SectionReports.

HyperlinkForeColor

Gets or sets the foreground color of hyperlinks displayed within the report viewer.

HyperlinkUnderline

Gets or sets a value indicating whether the hyperlink text within the report viewer is underlined. This property is applicable only to SectionReports.

MouseMode

Gets or sets the mouse interaction mode for the viewer.

MouseModeButtonsVisible

Gets or sets a value indicating whether the mouse mode buttons are visible in the viewer toolbar.

MultiplePageCols

Gets or sets the number of pages that are displayed horizontally in the viewer when it is in MultiPage view mode.

MultiplePageRows

Gets or sets the number of pages that are displayed vertically in the viewer when it is in MultiPage view mode.

OpenedReport

Gets the type of the report currently opened in the viewer.

PageOffset

Gets or sets the page offset in pixels, disregarding zoom level. This property can have distinct values for each pane and is applicable only in single page view mode.

PagesBackColor

Gets or sets the background color of the pages within the viewer.

PreviewPages

Gets or sets the number of pages to preview when loading a report. Setting this property to a value less than or equal to 0 will result in all pages being loaded and available for preview.

PrintingSettings

Gets or sets the printing settings for the Viewer, determining the behavior of the print operation.

RepositionPage

Gets or sets a value indicating whether the viewer repositions the view to the top of the page when a user navigates to another page after scrolling down on the current page.

ScrollbarEnabled

Gets or sets a value indicating whether scroll bars are enabled in the report viewer pane.

ScrollingMode

Gets or sets the scrolling behavior for the document within the viewer.

SearchResultsBackColor

Gets or sets the background color used to highlight text found using the search functionality in the Viewer control.

SearchResultsForeColor

Gets or sets the foreground color used to highlight text found using the search functionality in the Viewer control.

Sidebar

Gets the sidebar's public API, providing access to its functionality and panels.

SplitView

Gets or sets a value indicating whether the viewer is in Split View mode.

TableOfContents

Gets the Table of Contents panel within the viewer's sidebar.

TargetView

Gets or sets a value indicating the current target view when the SplitView feature is enabled.

Toolbar

Provides access to the viewer's toolbar, allowing for customization and control of toolbar buttons and functionality.

TouchContextMenuStrip

Gets or sets the context menu that appears when the user performs a long tap on the touch screen.

TouchMode

Gets or sets a value indicating whether the touch mode is enabled or disabled in the viewer.

TouchModeButtonVisibility

Gets or sets the visibility of the touch mode button on the viewer's toolbar.

TouchModeToolbar

Gets the toolbar used in touch mode.

UITheme

Specifies the visual theme for the viewer's user interface.

UseHyperlinkSettings

Gets or sets a value indicating whether the viewer should apply the specified hyperlink settings, such as color, underline, and background color, to hyperlinks within SectionReports.

ViewType

Gets or sets the view type for displaying pages within the viewer.

Zoom

Gets or sets the viewer's zoom level.

Methods

Name Description
CancelRender()

Cancels the current report rendering process.

Dispose(bool)

Cleans up any resources being used.

Export(IDocumentExport, FileInfo)

Exports the currently loaded report to the specified file using the given export filter.

Export(IDocumentExport, FileInfo, string)

Exports the specified page range of the currently loaded report to the specified file using the given export filter.

Export(IDocumentExport, Stream)

Exports the currently loaded report to the specified stream using the given export filter.

Export(IDocumentExport, Stream, string)

Exports the specified page range of the currently loaded report to the specified stream using the given export filter.

GetShortcutCommands()

Retrieves a collection of keyboard shortcuts configured for the viewer.

HandleError(Exception)

Handles runtime errors by reporting them to the viewer's model for appropriate action.

IsFplDocumentOpened()

Returns a value indicating whether an Fpl document is opened.

LoadDocument(PageDocument)

Loads the specified PageDocument into the Viewer control.

LoadDocument(SectionDocument)

Loads the specified SectionDocument into the Viewer control.

LoadDocument(PageReport)

Loads the specified PageReport into the Viewer control.

LoadDocument(SectionReport)

Loads the specified SectionReport into the Viewer control.

LoadDocument(IDocumentLoader)

Loads a document into the Viewer control using the specified document loader.

LoadDocument(Stream, DocumentFormat)

Loads a document into the viewer from a provided stream, using the specified document format.

LoadDocument(string)

Loads a document into the Viewer control from a specified file path.

OnAction(object, ActionEventArgs)

Fires the Action event when appropriate.

OnFontChanged(EventArgs)

Overridden. Raises the FontChanged event.

Print(PrintingSettings)

Initiates the printing process for the currently opened document, using the specified printing settings.

Print(bool)

Initiates the printing process for the currently opened document, either a section or a page report, with the option to display or bypass the print dialog.

Print(bool, bool)

Initiates the printing process for the currently opened document, allowing for the display of the print dialog and the print progress dialog based on the provided parameters.

Print(bool, bool, bool)

Initiates the printing process for the currently opened document, with options to display the print dialog, the print progress dialog, and to use a separate printing thread.

ProcessCmdKey(ref Message, Keys)

Overridden. Processes the command key.

Render(IRenderingExtension, StreamProvider, NameValueCollection)

Exports the specified loaded report to the specified file (or group of files) using the specified export extension.

SetParametersValues(IEnumerable<IParameter>)

Sets values for the parameters of the currently displayed report in the Viewer.

SetShortcutCommandState(ViewerCommand, bool)

Sets the enabled or disabled state of a specified viewer command.

ShowFindDialog()

Opens the Find Dialog to allow users to search for text within the report.

WndProc(ref Message)

Overridden. Processes Windows messages.

Events

Name Description
Action

Occurs when a report item, configured with an interactive action, is clicked within the report preview control.

ErrorOccured

Occurs when an error occurs within the viewer. This event provides detailed information about the error, allowing for custom error handling or logging.

Find

Occurs when the Find dialog successfully locates the specified text within the document.

Occurs when the user clicks on text or an image that has a hyperlink assigned to it.

LoadCompleted

Occurs after the document has been fully loaded and rendered in the viewer.

RefreshReport

Occurs before the report refreshes. This event is triggered in several scenarios, including:

  • Opening a new report.
  • Performing actions such as toggling, sorting, or executing drill-through actions within the report.
  • Interacting with the UI to view the report (e.g., using the parameters panel), toggling galley mode, refreshing the report, or navigating back to a parent report in a drill-through scenario. In the absence of any errors, this event precedes the LoadCompleted event.
TableOfContentsAfterSelect

Occurs after an item is selected in the table of contents treeview.

TableOfContentsClick

Occurs when the user clicks an item in the table of contents treeview.

TableOfContentsSelectedIndexChanged

Occurs when the index of the currently selected item in the table of contents changes.

ZoomChanged

Occurs when the zoom level of the viewer changes.