Class
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:

cs-api-definition
[ToolboxBitmap(typeof(ReportViewer), "Resources.ReportViewer.bmp")]
public class ReportViewer : WebControl

Inheritance: objectControlWebControlReportViewer

Constructors

ReportViewer()

Initializes a new instance of the HTML5 WebForms ReportViewer class with default settings and dimensions.

Declaration

cs-api-definition
public ReportViewer()

Properties

AccessibilityKeyMap

Gets or sets the keyboard mappings used when accessibility mode is enabled in the HTML5 viewer.

Declaration

cs-api-definition
[WebBrowsable(false)]
public AccessibilityKeyMap AccessibilityKeyMap { get; set; }

Property Value

AccessibilityKeyMap

Remarks

Defines custom key combinations for accessibility navigation including content area, document map, menu, and parameters area access when accessibility features are enabled.

AuthenticationToken

Gets or sets the encoded authentication token used to secure and authenticate requests between the HTML5 viewer and the reporting service.

Declaration

cs-api-definition
[WebBrowsable(true)]
public string AuthenticationToken { get; set; }

Property Value

string

Remarks

Provides security for report access and ensures that only authorized users can view reports through the HTML5 viewer interface.

CheckedButtonClass

Gets or sets the CSS class applied to toolbar buttons when they are in the checked or active state.

Declaration

cs-api-definition
[WebBrowsable(true)]
public string CheckedButtonClass { get; set; }

Property Value

string

Remarks

Enables custom styling of checked buttons in the HTML5 viewer toolbar for consistent visual design and user experience.

ClientEvents

Gets or sets the client-side event handlers configuration for the HTML5 report viewer.

Declaration

cs-api-definition
[WebBrowsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ClientEvents ClientEvents { get; set; }

Property Value

ClientEvents

Remarks

Provides a comprehensive way to attach JavaScript functions to various HTML5 viewer events including rendering, printing, exporting, and user interactions.

Deferred

Gets or sets a value indicating whether the HTML5 viewer's JavaScript initialization is deferred until a specific point in the page lifecycle.

Declaration

cs-api-definition
[WebBrowsable(true)]
public bool Deferred { get; set; }

Property Value

bool

Remarks

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

Gets or sets the CSS class applied to toolbar buttons when they are in the disabled state.

Declaration

cs-api-definition
[WebBrowsable(true)]
public string DisabledButtonClass { get; set; }

Property Value

string

Remarks

Enables custom styling of disabled buttons in the HTML5 viewer toolbar for consistent visual design and user experience.

DocumentMapAreaPosition

Gets or sets the positioning of the document map area within the HTML5 viewer interface.

Declaration

cs-api-definition
[WebBrowsable(true)]
public DocumentMapAreaPosition DocumentMapAreaPosition { get; set; }

Property Value

DocumentMapAreaPosition

Remarks

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.

DocumentMapVisible

Gets or sets a value indicating whether the document map navigation panel is initially visible in the HTML5 viewer.

Declaration

cs-api-definition
[WebBrowsable(true)]
public bool DocumentMapVisible { get; set; }

Property Value

bool

Remarks

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.

EnableAccessibility

Gets or sets a value indicating whether accessibility features are enabled for the HTML5 report viewer and its contents.

Declaration

cs-api-definition
[WebBrowsable(true)]
public bool EnableAccessibility { get; set; }

Property Value

bool

Remarks

When enabled, provides enhanced accessibility support including keyboard navigation, screen reader compatibility, and ARIA attributes for improved usability with assistive technologies.

Height

Gets or sets the height of the HTML5 ReportViewer control.

Declaration

cs-api-definition
public override Unit Height { get; set; }

Property Value

Unit

Overrides WebControl.Height

InitialPageAreaImageUrl

Gets or sets the background image URL displayed in the page area when parameter values are missing or invalid.

Declaration

cs-api-definition
[WebBrowsable(true)]
public string InitialPageAreaImageUrl { get; set; }

Property Value

string

Remarks

Provides visual feedback to users when the HTML5 viewer cannot display report content due to missing or invalid parameter values.

KeepClientAlive

Gets or sets a value indicating whether the HTML5 viewer client session is kept alive through periodic server requests.

Declaration

cs-api-definition
[WebBrowsable(true)]
public bool KeepClientAlive { get; set; }

Property Value

bool

Remarks

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.

PageMode

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.

Declaration

cs-api-definition
[WebBrowsable(true)]
public PageMode PageMode { get; set; }

Property Value

PageMode

Remarks

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

Gets or sets the current page number of the report displayed in the HTML5 viewer.

Declaration

cs-api-definition
[WebBrowsable(true)]
public int PageNumber { get; set; }

Property Value

int

Remarks

Determines which page is initially displayed when the report loads in the HTML5 viewer interface.

ParameterEditors

Gets or sets the parameter editors configuration that defines JavaScript functions for handling different parameter types in the HTML5 viewer.

Declaration

cs-api-definition
[WebBrowsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ParameterEditors ParameterEditors { get; set; }

Property Value

ParameterEditors

Remarks

Enables customization of parameter input controls by specifying JavaScript editor functions for different parameter scenarios including single-select, multi-select, and type-specific editors.

Parameters

Gets or sets the parameters display configuration that defines the visual appearance and behavior of parameter input controls.

Declaration

cs-api-definition
[WebBrowsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public Parameters Parameters { get; set; }

Property Value

Parameters

Remarks

Controls the parameter editor types and visual presentation styles for both single-select and multi-select parameter scenarios in the HTML5 viewer interface.

ParametersAreaPosition

Gets or sets the positioning of the parameters area within the HTML5 viewer interface.

Declaration

cs-api-definition
[WebBrowsable(true)]
public ParametersAreaPosition ParametersAreaPosition { get; set; }

Property Value

ParametersAreaPosition

Remarks

Controls the placement of parameter input controls relative to the report content area for optimal user experience and interface layout in HTML5 scenarios.

ParametersAreaVisible

Gets or sets a value indicating whether the parameters area is initially visible in the HTML5 viewer.

Declaration

cs-api-definition
[WebBrowsable(true)]
public bool ParametersAreaVisible { get; set; }

Property Value

bool

Remarks

Controls the initial visibility state of the parameters input area for reports that contain parameters requiring user input.

PersistSession

Gets or sets a value indicating whether the HTML5 viewer's client state is persisted between page refreshes and postbacks.

Declaration

cs-api-definition
[WebBrowsable(true)]
public bool PersistSession { get; set; }

Property Value

bool

Remarks

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.

PrintMode

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.

Declaration

cs-api-definition
[WebBrowsable(true)]
public PrintMode PrintMode { get; set; }

Property Value

PrintMode

Remarks

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.

ReportServer

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.

Declaration

cs-api-definition
[WebBrowsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ReportServer ReportServer { get; set; }

Property Value

ReportServer

Remarks

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.

ReportSource

Gets or sets the ReportSource for the report displayed in the HTML5 viewer.

Declaration

cs-api-definition
[WebBrowsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ReportSource ReportSource { get; set; }

Property Value

ReportSource

Remarks

Specifies the report to be displayed including its identifier, parameters, and source type for proper report loading and processing in the HTML5 environment.

Scale

Gets or sets the zoom level of the report where 1.0 equals 100% of the original report size.

Declaration

cs-api-definition
[WebBrowsable(true)]
public double Scale { get; set; }

Property Value

double

Remarks

Provides precise control over report magnification in the HTML5 viewer when using specific scaling mode or custom zoom requirements.

ScaleMode

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.

Declaration

cs-api-definition
[WebBrowsable(true)]
public ScaleMode ScaleMode { get; set; }

Property Value

ScaleMode

Remarks

Controls automatic report scaling behavior including FitPage for complete page visibility, FitPageWidth for width-based scaling, and Specific for custom scale values.

SearchMetadataOnDemand

Gets or sets a value indicating whether search metadata is delivered on-demand or preloaded with the report in the HTML5 viewer.

Declaration

cs-api-definition
[WebBrowsable(true)]
public bool SearchMetadataOnDemand { get; set; }

Property Value

bool

Remarks

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.

SendEmail

Gets or sets the email functionality configuration including enabled state, format selection, and default recipients.

Declaration

cs-api-definition
[WebBrowsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public SendEmail SendEmail { get; set; }

Property Value

SendEmail

Remarks

Configures the send email feature within the HTML5 viewer toolbar, including preselected rendering formats and default email addresses for enhanced user experience.

ServiceUrl

Gets or sets the URL of the service which will provide the report viewer with reports.

Declaration

cs-api-definition
[WebBrowsable(true)]
public string ServiceUrl { get; set; }

Property Value

string

Remarks

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

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.

Declaration

cs-api-definition
[WebBrowsable(true)]
public string TemplateUrl { get; set; }

Property Value

string

Remarks

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.

ViewMode

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.

Declaration

cs-api-definition
[WebBrowsable(true)]
public ViewMode ViewMode { get; set; }

Property Value

ViewMode

Remarks

Interactive mode enables full report interactivity and navigation, while PrintPreview mode optimizes the display for print layout without interactive features.

Width

Gets or sets the width of the HTML5 ReportViewer control.

Declaration

cs-api-definition
public override Unit Width { get; set; }

Property Value

Unit

Overrides WebControl.Width

Methods

GetReportParameters()

Gets the processed report parameters as a dictionary of parameter names and string values.

Declaration

cs-api-definition
public IDictionary<string, string> GetReportParameters()

Returns

IDictionary<string, string>

A dictionary containing parameter names as keys and their processed string values.

Remarks

Provides access to the current parameter values that have been processed and applied to the report in the HTML5 viewer.

LoadViewState(object)

Loads the view state and updates the HTML5 viewer configuration from the saved state data.

Declaration

cs-api-definition
protected override void LoadViewState(object savedState)

Parameters

savedState

object

The saved state object containing the HTML5 viewer's persisted configuration and settings.

Overrides WebControl.LoadViewState(object)

Remarks

Restores the viewer state and synchronizes client-side changes with server-side properties to maintain consistency across postbacks in the HTML5 viewer.

OnInit(EventArgs)

Initializes the HTML5 WebForms ReportViewer control during the Init phase of the page lifecycle.

Declaration

cs-api-definition
protected override void OnInit(EventArgs e)

Parameters

e

EventArgs

The EventArgs containing event data for the initialization process.

Overrides Control.OnInit(EventArgs)

Remarks

Updates the viewer state and settings from client-side data before calling the base initialization to ensure proper HTML5 viewer setup and configuration.

OnPreRender(EventArgs)

Performs final processing and resource registration before the HTML5 ReportViewer control is rendered to the client.

Declaration

cs-api-definition
protected override void OnPreRender(EventArgs e)

Parameters

e

EventArgs

The EventArgs containing event data for the pre-render process.

Overrides Control.OnPreRender(EventArgs)

Remarks

Registers necessary JavaScript and CSS resources required for HTML5 viewer functionality including scripts, styles, and client-side initialization code.

Render(HtmlTextWriter)

Renders the HTML5 ReportViewer control by outputting its contents to the specified HTML writer.

Declaration

cs-api-definition
protected override void Render(HtmlTextWriter writer)

Parameters

writer

HtmlTextWriter

The HtmlTextWriter object that receives the control output for rendering on the client.

Overrides WebControl.Render(HtmlTextWriter)

Remarks

Delegates to RenderContents to output the HTML5 viewer markup without additional wrapper elements for clean HTML5 structure.

RenderContents(HtmlTextWriter)

Renders the HTML5 ReportViewer control contents by writing the viewer markup to the specified HTML writer.

Declaration

cs-api-definition
protected override void RenderContents(HtmlTextWriter writer)

Parameters

writer

HtmlTextWriter

The HtmlTextWriter object that receives the HTML5 viewer markup for output to the client.

Overrides WebControl.RenderContents(HtmlTextWriter)

Remarks

Generates the complete HTML5 viewer markup including container elements, initialization scripts, and configuration options for client-side rendering.

RenderDesignTimeHtml(HtmlTextWriter)

Renders the HTML5 ReportViewer control for design-time display in Visual Studio designer.

Declaration

cs-api-definition
public void RenderDesignTimeHtml(HtmlTextWriter writer)

Parameters

writer

HtmlTextWriter

The HtmlTextWriter object that receives the design-time HTML output.

Remarks

Generates a simplified HTML representation of the HTML5 viewer for Visual Studio design surface display, showing the control dimensions and identification.

ToString()

Converts the HTML5 ReportViewer control to its HTML string representation with all configuration options and client-side initialization.

Declaration

cs-api-definition
public override string ToString()

Returns

string

A complete HTML string containing the HTML5 viewer markup, scripts, and configuration for browser rendering.

Overrides object.ToString()

Remarks

Generates the final HTML output by populating viewer options and using ReportViewerWriter to create the complete HTML5 viewer structure with JavaScript initialization.