[]
Represents the WPF Viewer.
[ToolboxBitmap(typeof(WpfResources), "GrapeCity.ActiveReports.Viewer.Wpf.Viewer.bmp")]
[TemplatePart(Name = "Sidebar", Type = typeof(TabControl))]
[TemplatePart(Name = "TocPanel", Type = typeof(TocPanel))]
[TemplatePart(Name = "ThumbnailPanel", Type = typeof(ThumbnailPanel))]
[TemplatePart(Name = "ViewerBorder", Type = typeof(Border))]
[TemplatePart(Name = "Toolbar", Type = typeof(MainToolbar))]
[TemplatePart(Name = "ReportGrid", Type = typeof(Grid))]
[TemplatePart(Name = "SecondaryViewRow", Type = typeof(RowDefinition))]
[TemplatePart(Name = "SecondaryView", Type = typeof(ReportViewer))]
[TemplatePart(Name = "ViewSplitter", Type = typeof(GridSplitter))]
[TemplatePart(Name = "PrimaryView", Type = typeof(ReportViewer))]
public class Viewer : Control, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IDisposable
The Viewer control allows displaying and interacting with reports in a WPF application.
The following example shows how to create a Viewer instance in XAML:
<Window x:Class="MyNamespace.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:viewer="clr-namespace:GrapeCity.ActiveReports.Viewer.Wpf;assembly=GrapeCity.ActiveReports.Viewer.Wpf"
Title="MainWindow" Height="450" Width="800">
<Grid>
<viewer:Viewer x:Name="reportViewer" />
</Grid>
</Window>
The following example shows how to load a report into the Viewer in code-behind:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
reportViewer.LoadDocument("path/to/your/report.rdlx");
}
}
For more information on customizing the WPF Viewer, see the documentation page.
Name | Description |
---|---|
Viewer() | Initializes a new instance of the Viewer class. |
Name | Description |
---|---|
AllowSplitterProperty | Identifies the AllowSplitter dependency property. |
HyperlinkBackColorProperty | Identifies the HyperlinkBackColor dependency property. |
HyperlinkForeColorProperty | Identifies the HyperlinkForeColor dependency property. |
HyperlinkUnderlineProperty | Identifies the HyperlinkUnderline dependency property. |
MultiplePageColsProperty | Identifies the MultiplePageCols dependency property. |
MultiplePageRowsProperty | Identifies the MultiplePageRows dependency property. |
PagesBackColorProperty | Identifies the PagesBackColor dependency property. |
PreviewPagesProperty | Identifies the PreviewPages dependency property. |
PrintingSettingsProperty | Identifies the GrapeCity.ActiveReports.Viewer.Wpf.Viewer.DesignPrintingSettings dependency property. |
RepositionPageProperty | Identifies the RepositionPage dependency property. |
ScrollbarEnabledProperty | Identifies the ScrollbarEnabled dependency property. |
SearchResultsBackColorProperty | Identifies the SearchResultsBackColor dependency property. |
SearchResultsForeColorProperty | Identifies the SearchResultsForeColor dependency property. |
SourceFormatProperty | Identifies the SourceFormat dependency property. |
SourceProperty | Identifies the Source dependency property. |
SplitViewProperty | Identifies the SplitView dependency property. |
TargetViewProperty | Identifies the TargetView dependency property. |
UseHyperlinkSettingsProperty | Identifies the UseHyperlinkSettings dependency property. |
ViewTypeProperty | Identifies the ViewType dependency property. |
ZoomProperty | Identifies the Zoom dependency property. |
Name | Description |
---|---|
AllowSplitter | Gets or sets a value that determines whether the user is allowed to split the view. |
AutoBackgroundColor | Gets or sets a value indicating whether the viewer should fill the entire view area with the report page background color. |
CanExport | Gets a value indicating whether export is permitted. |
CurrentPage | Gets or sets the number of the current document page displayed in the viewer. The page numbering is 1-based. |
Document | Gets the section report document displayed in the viewer. |
GalleyMode | Gets or sets GalleyMode of report |
History | Gets the history API for manipulating the viewer's history. |
HyperlinkBackColor | Gets or sets a value indicating the hyperlinks background color in the displayed document. |
HyperlinkForeColor | Gets or sets a value indicating the hyperlinks text color in the displayed document. |
HyperlinkUnderline | Gets or sets a value indicating whether the hyperlinks text should be underlined in the displayed document. |
MultiplePageCols | Gets or sets a value indicating the number of pages displayed horizontally when the viewer is in MultiPageMode. |
MultiplePageRows | Gets or sets a value indicating the number of pages displayed vertically when the viewer is in MultiPageMode. |
PagesBackColor | Gets or sets a value that indicates the background color of the report pane. |
PreviewPages | Gets or sets the number of pages to load. Pass a value less than or equal to 0 to load all pages. |
PrintingSettings | Gets or sets a value representing the printing settings for the currently displayed report. |
RepositionPage | Gets or sets a value that determines whether the viewer will reposition the view to the top of the page when a user goes to another page after scrolling downward in a page. |
ScrollbarEnabled | Gets or sets a value that determines whether the scrollbars are enabled within the report pane. |
SearchResultsBackColor | Gets or sets a value indicating the background color of the search result. |
SearchResultsForeColor | Gets or sets a value indicating the text color of the search result. |
Sidebar | Gets the sidebar API for manipulating the sidebar panels. |
Source | Gets or sets the local or remote URI of the report to display in the Viewer. |
SourceFormat | Gets or sets a value indicating the format of the report URI. |
SplitView | Gets or sets a value that determines whether the viewer is split into two views. |
TableOfContents | Gets the table of contents panel API. |
TargetView | Gets or sets a value that specifies the current target view when SplitView is enabled. |
UseHyperlinkSettings | Gets or sets a value indicating whether to apply the hyperlink settings when hyperlinks are displayed in the Viewer. |
ViewType | Gets or sets a value that determines how the viewer shows pages (single/multi/continuous). |
Zoom | Gets or sets the viewer's zoom level. |
Name | Description |
---|---|
Dispose() | Releases the resources used by the Viewer control. |
Export(IDocumentExport, FileInfo) | Exports the specified page range of the currently loaded report to the specified file by using the specified export filter. |
Export(IDocumentExport, FileInfo, string) | Exports the specified page range of the currently loaded report to the specified file by using the specified export filter. |
Export(IDocumentExport, Stream) | Exports the specified page range of the currently loaded report to the specified stream by using the specified export filter. |
Export(IDocumentExport, Stream, string) | Exports the specified page range of the currently loaded report to the specified stream by using the specified export filter. |
HandleError(Exception) | Handles runtime error on the viewer. |
LoadDocument(PageDocument) | Loads the specified page document. |
LoadDocument(SectionDocument) | Loads the specified section document. |
LoadDocument(PageReport) | Loads the specified page report. |
LoadDocument(SectionReport) | Loads the specified section report. |
LoadDocument(IDocumentLoader) | Loads a report from the specified IDocumentLoader parameter. |
LoadDocument(Stream, DocumentFormat) | Loads the document from a stream. |
LoadDocument(string) | Loads a report from the specified file path. |
OnAction(object, ActionEventArgs) | Helper method fires RenderingCompleted event when appropriate. |
OnApplyTemplate() | Initializes viewer panels. |
Print(PrintingSettings) | Prints the currently opened report. |
Print(bool) | Prints the currently opened report. |
Print(bool, bool) | Prints the currently opened report. |
Print(bool, bool, bool) | Prints the currently opened report. |
Render(IRenderingExtension, StreamProvider, NameValueCollection) | Exports the specified loaded report to the specified file (or group of files) by using the specified rendering extension. |
SetParametersValues(IEnumerable<IParameter>) | Sets the values of the parameters for the currently displayed report. |
Name | Description |
---|---|
Action | Occurs when an action is performed on the document in the viewer. |
ErrorOccured | Occurs when an error occurs within the viewer. This event provides detailed information about the error, allowing for custom error handling or logging. |
HyperLink | Occurs when a hyperlink is clicked in the currently opened document. |
LoadCompleted | Occurs after all the viewer pages have been fully loaded. |
RefreshReport | Occurs before the viewer refreshes the report. |