ReportViewer
Represents the HTML5 WebForms ReportViewer control that provides comprehensive report viewing capabilities with modern HTML5-based rendering and interactive user interface. Used to display Telerik Reporting reports within ASP.NET WebForms applications with full JavaScript-based client-side functionality for report interaction, navigation, and management.
Definition
Namespace:Telerik.ReportViewer.Html5.WebForms
Assembly:Telerik.ReportViewer.Html5.WebForms.dll
Syntax:
[ToolboxBitmap(typeof(ReportViewer), "Resources.ReportViewer.bmp")]
public class ReportViewer : WebControl
Inheritance: objectControlWebControlReportViewer
Constructors
Initializes a new instance of the HTML5 WebForms ReportViewer class with default settings and dimensions.
public ReportViewer()
Properties
Gets or sets the keyboard mappings used when accessibility mode is enabled in the HTML5 viewer.
[WebBrowsable(false)]
public AccessibilityKeyMap AccessibilityKeyMap { get; set; }
Defines custom key combinations for accessibility navigation including content area, document map, menu, and parameters area access when accessibility features are enabled.
AuthenticationToken
string
Gets or sets the encoded authentication token used to secure and authenticate requests between the HTML5 viewer and the reporting service.
[WebBrowsable(true)]
public string AuthenticationToken { get; set; }
Provides security for report access and ensures that only authorized users can view reports through the HTML5 viewer interface.
CheckedButtonClass
string
Gets or sets the CSS class applied to toolbar buttons when they are in the checked or active state.
[WebBrowsable(true)]
public string CheckedButtonClass { get; set; }
Enables custom styling of checked buttons in the HTML5 viewer toolbar for consistent visual design and user experience.
Gets or sets the client-side event handlers configuration for the HTML5 report viewer.
[WebBrowsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ClientEvents ClientEvents { get; set; }
Provides a comprehensive way to attach JavaScript functions to various HTML5 viewer events including rendering, printing, exporting, and user interactions.
Deferred
bool
Gets or sets a value indicating whether the HTML5 viewer's JavaScript initialization is deferred until a specific point in the page lifecycle.
[WebBrowsable(true)]
public bool Deferred { get; set; }
When enabled, allows for more controlled initialization timing of the HTML5 viewer, which can be useful for complex page scenarios or custom loading sequences.
DisabledButtonClass
string
Gets or sets the CSS class applied to toolbar buttons when they are in the disabled state.
[WebBrowsable(true)]
public string DisabledButtonClass { get; set; }
Enables custom styling of disabled buttons in the HTML5 viewer toolbar for consistent visual design and user experience.
Gets or sets the positioning of the document map area within the HTML5 viewer interface.
[WebBrowsable(true)]
public DocumentMapAreaPosition DocumentMapAreaPosition { get; set; }
Controls the placement of the document map navigation panel relative to the report content area for optimal user experience and interface layout in HTML5 scenarios.
Gets or sets a value indicating whether the document map navigation panel is initially visible in the HTML5 viewer.
[WebBrowsable(true)]
public bool DocumentMapVisible { get; set; }
Controls the initial visibility state of the document map that provides hierarchical navigation through report bookmarks and sections. The document map is shown only if the report contains bookmarks. The document map works both in the interactive and print preview view modes.
Gets or sets a value indicating whether accessibility features are enabled for the HTML5 report viewer and its contents.
[WebBrowsable(true)]
public bool EnableAccessibility { get; set; }
When enabled, provides enhanced accessibility support including keyboard navigation, screen reader compatibility, and ARIA attributes for improved usability with assistive technologies.
Height
Unit
Gets or sets the height of the HTML5 ReportViewer control.
public override Unit Height { get; set; }
Overrides:
InitialPageAreaImageUrl
string
Gets or sets the background image URL displayed in the page area when parameter values are missing or invalid.
[WebBrowsable(true)]
public string InitialPageAreaImageUrl { get; set; }
Provides visual feedback to users when the HTML5 viewer cannot display report content due to missing or invalid parameter values.
KeepClientAlive
bool
Gets or sets a value indicating whether the HTML5 viewer client session is kept alive through periodic server requests.
[WebBrowsable(true)]
public bool KeepClientAlive { get; set; }
When enabled, prevents client session expiration by sending keep-alive requests to the server based on the ClientSessionTimeout configuration. When disabled, the client session may expire naturally.
Gets or sets the viewer's page mode. SinglePage - Displays only one report page in PageArea container. ContinuousScroll - Displays large amount of report pages by appending additional pages on demand.
[WebBrowsable(true)]
public PageMode PageMode { get; set; }
ContinuousScroll mode enables seamless scrolling through multiple pages with on-demand loading, while SinglePage mode displays one page at a time for focused viewing.
PageNumber
int
Gets or sets the current page number of the report displayed in the HTML5 viewer.
[WebBrowsable(true)]
public int PageNumber { get; set; }
Determines which page is initially displayed when the report loads in the HTML5 viewer interface.
Gets or sets the parameter editors configuration that defines JavaScript functions for handling different parameter types in the HTML5 viewer.
[WebBrowsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ParameterEditors ParameterEditors { get; set; }
Enables customization of parameter input controls by specifying JavaScript editor functions for different parameter scenarios including single-select, multi-select, and type-specific editors.
Gets or sets the parameters display configuration that defines the visual appearance and behavior of parameter input controls.
[WebBrowsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public Parameters Parameters { get; set; }
Controls the parameter editor types and visual presentation styles for both single-select and multi-select parameter scenarios in the HTML5 viewer interface.
Gets or sets the positioning of the parameters area within the HTML5 viewer interface.
[WebBrowsable(true)]
public ParametersAreaPosition ParametersAreaPosition { get; set; }
Controls the placement of parameter input controls relative to the report content area for optimal user experience and interface layout in HTML5 scenarios.
Gets or sets a value indicating whether the parameters area is initially visible in the HTML5 viewer.
[WebBrowsable(true)]
public bool ParametersAreaVisible { get; set; }
Controls the initial visibility state of the parameters input area for reports that contain parameters requiring user input.
PersistSession
bool
Gets or sets a value indicating whether the HTML5 viewer's client state is persisted between page refreshes and postbacks.
[WebBrowsable(true)]
public bool PersistSession { get; set; }
When enabled, the viewer state is stored in the browser's sessionStorage and maintained for the duration of the page session, preserving user settings and navigation state.
Gets or sets the print mode of the viewer. Three modes exist currently: AutoSelect - Specifies that the viewer should automatically determine how to print: through the browser's PDF plug-in or through export to a PDF file. ForcePDFPlugin - Specifies that the viewer should always use the PDF plugin regardless of the browser's version and settings. ForcePDFFile - Specifies that the viewer should always export the report document to PDF format with the 'print' script enabled.
[WebBrowsable(true)]
public PrintMode PrintMode { get; set; }
Controls the printing workflow to ensure optimal print experience across different browsers and PDF plugin configurations in HTML5 environments. Available modes include AutoSelect for intelligent method selection, ForcePDFPlugin for direct plugin usage, and ForcePDFFile for download-based printing.
Gets or sets the connection data of the report server that hosts the report. The report server can have its Guest account enabled and with configured permissions for accessing the report without permisions.
[WebBrowsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ReportServer ReportServer { get; set; }
Used when the viewer is connected to a Telerik Report Server instance (takes precedence over the ServiceUrl property) The Report Server must have appropriate user accounts configured with necessary permissions for accessing and viewing reports in the HTML5 viewer environment. Connecting to Telerik Report Server for .NET is not supported. For more information see https://www.telerik.com/help/reporting/html5-report-viewer-howto-use-it-with-reportserver.html.
Gets or sets the ReportSource for the report displayed in the HTML5 viewer.
[WebBrowsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ReportSource ReportSource { get; set; }
Specifies the report to be displayed including its identifier, parameters, and source type for proper report loading and processing in the HTML5 environment.
Scale
double
Gets or sets the zoom level of the report where 1.0 equals 100% of the original report size.
[WebBrowsable(true)]
public double Scale { get; set; }
Provides precise control over report magnification in the HTML5 viewer when using specific scaling mode or custom zoom requirements.
Gets or sets the scale mode of the viewer. Three modes exist currently: FitPage - The whole report will fit on the page (will zoom in or out), regardless of its width and height. FitPageWidth - The report will be zoomed in or out so that the width of the screen and the width of the report match. Specific - Uses the scale to zoom in and out the report.
[WebBrowsable(true)]
public ScaleMode ScaleMode { get; set; }
Controls automatic report scaling behavior including FitPage for complete page visibility, FitPageWidth for width-based scaling, and Specific for custom scale values.
Gets or sets a value indicating whether search metadata is delivered on-demand or preloaded with the report in the HTML5 viewer.
[WebBrowsable(true)]
public bool SearchMetadataOnDemand { get; set; }
When enabled, search metadata is loaded only when needed, reducing initial load time but potentially increasing search operation latency. When disabled, search metadata is preloaded for faster search operations.
Gets or sets the email functionality configuration including enabled state, format selection, and default recipients.
[WebBrowsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public SendEmail SendEmail { get; set; }
Configures the send email feature within the HTML5 viewer toolbar, including preselected rendering formats and default email addresses for enhanced user experience.
ServiceUrl
string
Gets or sets the URL of the service which will provide the report viewer with reports.
[WebBrowsable(true)]
public string ServiceUrl { get; set; }
The service must be properly configured so that the report viewer can successfully communicate with the server. For more information on how to configure the service please check https://docs.telerik.com/reporting/embedding-reports/host-the-report-engine-remotely/telerik-reporting-rest-services/overview.
TemplateUrl
string
Gets or sets the URL for the report viewer template. The template can be edited - new functionalities can be added and not needed ones can be removed. For more information please check https://www.telerik.com/help/reporting/html5-report-viewer-templates.html.
[WebBrowsable(true)]
public string TemplateUrl { get; set; }
Enables customization of the HTML5 viewer interface by specifying a custom template URL. If left empty, the default template is used for standard viewer functionality.
Gets or sets the viewer's view mode. PrintPreview - Displays the paginated report as if it is printed on paper. Interactivity is not enabled. Interactive - Displays the report in its original width and height with no paging. Additionally interactivity is enabled.
[WebBrowsable(true)]
public ViewMode ViewMode { get; set; }
Interactive mode enables full report interactivity and navigation, while PrintPreview mode optimizes the display for print layout without interactive features.
Width
Unit
Gets or sets the width of the HTML5 ReportViewer control.
public override Unit Width { get; set; }
Overrides:
Methods
GetReportParameters()
IDictionary<string, string>
Gets the processed report parameters as a dictionary of parameter names and string values.
public IDictionary<string, string> GetReportParameters()
IDictionary<string, string>
A dictionary containing parameter names as keys and their processed string values.
Provides access to the current parameter values that have been processed and applied to the report in the HTML5 viewer.
Loads the view state and updates the HTML5 viewer configuration from the saved state data.
protected override void LoadViewState(object savedState)
The saved state object containing the HTML5 viewer's persisted configuration and settings.
Overrides:
Restores the viewer state and synchronizes client-side changes with server-side properties to maintain consistency across postbacks in the HTML5 viewer.
Initializes the HTML5 WebForms ReportViewer control during the Init phase of the page lifecycle.
protected override void OnInit(EventArgs e)
The EventArgs containing event data for the initialization process.
Overrides:
Updates the viewer state and settings from client-side data before calling the base initialization to ensure proper HTML5 viewer setup and configuration.
Performs final processing and resource registration before the HTML5 ReportViewer control is rendered to the client.
protected override void OnPreRender(EventArgs e)
The EventArgs containing event data for the pre-render process.
Overrides:
Registers necessary JavaScript and CSS resources required for HTML5 viewer functionality including scripts, styles, and client-side initialization code.
Renders the HTML5 ReportViewer control by outputting its contents to the specified HTML writer.
protected override void Render(HtmlTextWriter writer)
The HtmlTextWriter object that receives the control output for rendering on the client.
Overrides:
Delegates to RenderContents to output the HTML5 viewer markup without additional wrapper elements for clean HTML5 structure.
Renders the HTML5 ReportViewer control contents by writing the viewer markup to the specified HTML writer.
protected override void RenderContents(HtmlTextWriter writer)
The HtmlTextWriter object that receives the HTML5 viewer markup for output to the client.
Overrides:
Generates the complete HTML5 viewer markup including container elements, initialization scripts, and configuration options for client-side rendering.
Renders the HTML5 ReportViewer control for design-time display in Visual Studio designer.
public void RenderDesignTimeHtml(HtmlTextWriter writer)
The HtmlTextWriter object that receives the design-time HTML output.
Generates a simplified HTML representation of the HTML5 viewer for Visual Studio design surface display, showing the control dimensions and identification.
ToString()
string
Converts the HTML5 ReportViewer control to its HTML string representation with all configuration options and client-side initialization.
public override string ToString()
string
A complete HTML string containing the HTML5 viewer markup, scripts, and configuration for browser rendering.
Overrides:
Generates the final HTML output by populating viewer options and using ReportViewerWriter to create the complete HTML5 viewer structure with JavaScript initialization.