Interface
IReportViewerBuilder

Represents a builder that provides a fluent API for configuring and initializing the MVC Report Viewer. Used to set up all aspects of the report viewer including report sources, display options, authentication, and client-side behavior.

Definition

Namespace:Telerik.ReportViewer.Mvc

Assembly:Telerik.ReportViewer.Mvc.dll

Syntax:

cs-api-definition
public interface IReportViewerBuilder

Methods

AccessibilityKeyMap(AccessibilityKeyMap)

Sets the key mappings used in accessibility mode for keyboard navigation.

Declaration

cs-api-definition
IReportViewerBuilder AccessibilityKeyMap(AccessibilityKeyMap keyMap)

Parameters

keyMap

AccessibilityKeyMap

The AccessibilityKeyMap configuration object defining keyboard shortcuts and navigation keys.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Customizes keyboard shortcuts for accessibility navigation to meet specific application or user requirements.

AuthenticationToken(string)

Sets the encoded authentication token used to authenticate requests to the reporting service.

Declaration

cs-api-definition
IReportViewerBuilder AuthenticationToken(string token)

Parameters

token

string

The encoded authentication token string for secure communication with the reporting service.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Used for secured reporting services that require authentication tokens for request authorization.

CheckedButtonClass(string)

Sets the CSS class to be applied to buttons when they are in checked state.

Declaration

cs-api-definition
IReportViewerBuilder CheckedButtonClass(string checkedButtonClass)

Parameters

checkedButtonClass

string

The CSS class name for styling checked/pressed buttons in the viewer interface.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Allows customization of checked button appearance to match application styling requirements.

ClientEvents(Action<IClientEventsBuilder>)

Provides a fluent way to configure the client-side event handlers of the report viewer.

Declaration

cs-api-definition
IReportViewerBuilder ClientEvents(Action<IClientEventsBuilder> clientEventsBuilder)

Parameters

clientEventsBuilder

Action<IClientEventsBuilder>

An action delegate that receives an IClientEventsBuilder for configuring event handlers.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Enables attachment of JavaScript functions to handle various viewer events such as rendering, printing, and user interactions.

Deferred()

Defers the JavaScript initialization statement for the report viewer.

Declaration

cs-api-definition
IReportViewerBuilder Deferred()

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Allows manual control over when the viewer initialization script is executed for custom loading scenarios.

DirectPrint(bool)

Sets whether the viewer should use the browser's Adobe PDF plug-in for the print action.

Declaration

cs-api-definition
[Obsolete("Telerik.ReportViewer.Mvc.IReportViewerBuilder.DirectPrint(bool) is now obsolete. Please use Telerik.ReportViewer.Mvc.IReportViewerBuilder.PrintMode(Telerik.ReportViewer.Mvc.PrintMode) overload instead.")]
IReportViewerBuilder DirectPrint(bool directPrint)

Parameters

directPrint

bool

True to enable direct PDF plugin printing, false to use alternative print methods.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

DisabledButtonClass(string)

Sets the CSS class to be applied to buttons when they are in disabled state.

Declaration

cs-api-definition
IReportViewerBuilder DisabledButtonClass(string disabledButtonClass)

Parameters

disabledButtonClass

string

The CSS class name for styling disabled buttons in the viewer interface.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Allows customization of disabled button appearance to match application styling requirements.

DocumentMapAreaPosition(DocumentMapAreaPosition)

Specifies where the Document Map Area should be displayed. Right - Displays Document Map Area on the right of the page view. Left - Displays Document Map Area on the left of the page view.

Declaration

cs-api-definition
IReportViewerBuilder DocumentMapAreaPosition(DocumentMapAreaPosition documentMapAreaPosition)

Parameters

documentMapAreaPosition

DocumentMapAreaPosition

The DocumentMapAreaPosition enumeration value specifying the position: Right or Left relative to the page view.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Controls the placement of the document map navigation panel for report bookmark and section navigation.

DocumentMapVisible(bool)

Sets the initial visibility state of the viewer's document map.

Declaration

cs-api-definition
IReportViewerBuilder DocumentMapVisible(bool visible)

Parameters

visible

bool

True to show the document map by default, false to hide it initially.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Controls whether the document map navigation panel is visible when the viewer first loads. 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(bool)

Enables or disables the accessibility features of the report viewer and its contents.

Declaration

cs-api-definition
IReportViewerBuilder EnableAccessibility(bool enable)

Parameters

enable

bool

True to enable accessibility features for screen readers and keyboard navigation, false to disable them.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Accessibility features include ARIA attributes, keyboard navigation support, and screen reader compatibility.

Id(string)

Sets the unique identifier for the MVC Report Viewer HTML element that will be used by the initialization script to locate and initialize the viewer.

Declaration

cs-api-definition
IReportViewerBuilder Id(string id)

Parameters

id

string

The unique HTML element identifier string that will be assigned to the report viewer container.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

This identifier is required for proper viewer initialization and must be unique within the page HTML structure.

InitialPageAreaImageUrl(string)

Sets the background image URL for the PageArea when parameter values are missing or invalid.

Declaration

cs-api-definition
IReportViewerBuilder InitialPageAreaImageUrl(string initialPageAreaImageUrl)

Parameters

initialPageAreaImageUrl

string

The URL of the background image to display in the page area during initial state or parameter validation errors.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Provides visual feedback to users when the report cannot be displayed due to missing or invalid parameters.

KeepClientAlive(bool)

Sets whether the client session will be kept alive by sending periodic requests to prevent session timeout.

Declaration

cs-api-definition
IReportViewerBuilder KeepClientAlive(bool keepClientAlive)

Parameters

keepClientAlive

bool

True to send keep-alive requests based on ClientSessionTimeout configuration, false to allow natural session expiration.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Prevents client session expiration during extended report viewing sessions by maintaining server communication.

PageMode(PageMode)

Specifies whether the viewer is in Continuous scroll or Single 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
IReportViewerBuilder PageMode(PageMode pageMode)

Parameters

pageMode

PageMode

The PageMode enumeration value: SinglePage for one page display, or ContinuousScroll for multiple pages with on-demand loading.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

SinglePage shows only one report page at a time, while ContinuousScroll enables scrolling through multiple pages with progressive loading.

ParameterEditors(Action<IParameterEditorsBuilder>)

Provides a fluent way to configure custom parameter editors for the report viewer.

Declaration

cs-api-definition
IReportViewerBuilder ParameterEditors(Action<IParameterEditorsBuilder> parameterEditorsBuilder)

Parameters

parameterEditorsBuilder

Action<IParameterEditorsBuilder>

An action delegate that receives an IParameterEditorsBuilder for configuring custom parameter input controls.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Enables replacement of default parameter input controls with custom JavaScript-based editors for enhanced user experience.

Parameters(Parameters)

Configures the report parameters display and interaction options.

Declaration

cs-api-definition
IReportViewerBuilder Parameters(Parameters parametersOptions)

Parameters

parametersOptions

Parameters

The Parameters configuration object that defines parameter area behavior and appearance.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Controls how report parameters are displayed and managed within the viewer interface.

ParametersAreaPosition(ParametersAreaPosition)

Specifies where the Parameters Area should be displayed. Right - Displays Parameters Area on the right of the page view. Left - Displays Parameters Area on the left of the page view. Top - Displays Parameters Area on the top of the page view. Bottom - Displays Parameters Area on the bottom of the page view.

Declaration

cs-api-definition
IReportViewerBuilder ParametersAreaPosition(ParametersAreaPosition parametersAreaPosition)

Parameters

parametersAreaPosition

ParametersAreaPosition

The ParametersAreaPosition enumeration value specifying the position: Right, Left, Top, or Bottom relative to the page view.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Controls the placement of the parameters panel for optimal user experience and interface layout.

ParametersAreaVisible(bool)

Sets the initial visibility state of the viewer's parameters area.

Declaration

cs-api-definition
IReportViewerBuilder ParametersAreaVisible(bool visible)

Parameters

visible

bool

True to show the parameters area by default, false to hide it initially.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Controls whether the parameters panel is visible when the viewer first loads, regardless of parameter presence.

PersistSession(bool)

Sets whether the viewer's client session should be persisted between page refreshes using browser sessionStorage.

Declaration

cs-api-definition
IReportViewerBuilder PersistSession(bool persistSession)

Parameters

persistSession

bool

True to enable session persistence across page refreshes, false to use default session behavior.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Session persistence maintains viewer state during postbacks and page refreshes for improved user experience.

PrintMode(PrintMode)

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
IReportViewerBuilder PrintMode(PrintMode printMode)

Parameters

printMode

PrintMode

The PrintMode enumeration value: AutoSelect for automatic method selection, ForcePDFPlugin for PDF plugin usage, or ForcePDFFile for PDF file export with print script.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Controls the printing mechanism based on browser capabilities and user requirements for optimal print experience.

ReportResolver(IReportResolver)

Sets the chain of report resolvers for custom report loading logic.

Declaration

cs-api-definition
[Obsolete]
IReportViewerBuilder ReportResolver(IReportResolver resolver)

Parameters

resolver

IReportResolver

The IReportResolver implementation for custom report resolution.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

ReportServer(ReportServer)

Sets the connection data for the Telerik Report Server that hosts the reports.

Declaration

cs-api-definition
IReportViewerBuilder ReportServer(ReportServer reportServer)

Parameters

reportServer

ReportServer

The ReportServer configuration object containing connection and authentication information for Report Server integration.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Used when the viewer is connected to a Telerik Report Server instance (takes precedence over the ServiceUrl property) Connecting to Telerik Report Server for .NET is not supported.

ReportSource(ReportSource)

Sets the ReportSource for the report displayed in the viewer.

Declaration

cs-api-definition
[Obsolete]
IReportViewerBuilder ReportSource(ReportSource reportSource)

Parameters

reportSource

ReportSource

The report source configuration object.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

ReportSource(TypeReportSource)

Sets the report source as a TypeReportSource for the report displayed in the viewer.

Declaration

cs-api-definition
IReportViewerBuilder ReportSource(TypeReportSource typeReportSource)

Parameters

typeReportSource

TypeReportSource

The TypeReportSource configuration that references a report class type for strongly-typed report loading.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Used for reports that are implemented as .NET classes and referenced by their type information.

ReportSource(UriReportSource)

Sets the report source as a UriReportSource for the report displayed in the viewer.

Declaration

cs-api-definition
IReportViewerBuilder ReportSource(UriReportSource uriReportSource)

Parameters

uriReportSource

UriReportSource

The UriReportSource configuration that references a report file by its URI location.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Used for reports stored as files that are referenced by their file system or web URI location.

ReportSource(string)

Sets the report source as a string identifier for the report displayed in the viewer.

Declaration

cs-api-definition
IReportViewerBuilder ReportSource(string report)

Parameters

report

string

The string identifier or path that uniquely identifies the report to be loaded.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Simplified method for specifying reports using string-based identification without additional configuration.

ReportSource(string, IDictionary<string, object>)

Sets the report source as a string identifier and provides parameter values for the report displayed in the viewer.

Declaration

cs-api-definition
IReportViewerBuilder ReportSource(string report, IDictionary<string, object> parameters)

Parameters

report

string

The string identifier or path that uniquely identifies the report to be loaded.

parameters

IDictionary<string, object>

The IDictionary<TKey, TValue> containing parameter name-value pairs for report initialization.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Combines report identification with parameter initialization for streamlined report setup with predefined values.

Scale(double)

Sets the zoom scale factor for the report display when using Specific scale mode.

Declaration

cs-api-definition
IReportViewerBuilder Scale(double scale)

Parameters

scale

double

The scale factor as a decimal value where 1.0 equals 100% (original size), values greater than 1.0 zoom in, and values less than 1.0 zoom out.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Only effective when ScaleMode is set to Specific, allowing precise control over report magnification.

ScaleMode(ScaleMode)

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
IReportViewerBuilder ScaleMode(ScaleMode scaleMode)

Parameters

scaleMode

ScaleMode

The ScaleMode enumeration value: FitPage for full page fitting, FitPageWidth for width-based fitting, or Specific for custom scale values.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Determines how the report is sized within the viewer area to optimize readability and user experience.

ScaleMode(ScaleModes)

Sets the scale mode of the viewer. Three modes exist currently: FIT_PAGE - The whole report will fit on the page (will zoom in or out), regardless of its width and height. FIT_PAGE_WIDTH - 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
[Obsolete("Telerik.ReportViewer.Mvc.IReportViewerBuilder.ScaleMode(Telerik.ReportViewer.Mvc.ScaleModes) is now obsolete. Please use Telerik.ReportViewer.Mvc.IReportViewerBuilder.ScaleMode(Telerik.ReportViewer.Mvc.ScaleMode) overload instead.")]
IReportViewerBuilder ScaleMode(ScaleModes scaleMode)

Parameters

scaleMode

ScaleModes

The ScaleModes enumeration value for sizing behavior.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

SearchMetadataOnDemand(bool)

Determines whether the search metadata will be delivered on demand or generated by default during report rendering.

Declaration

cs-api-definition
IReportViewerBuilder SearchMetadataOnDemand(bool enable)

Parameters

enable

bool

True to generate search metadata on demand only when needed, false to generate it during initial report rendering.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

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

SendEmail(SendEmail)

Configures the send email functionality options for the report viewer.

Declaration

cs-api-definition
IReportViewerBuilder SendEmail(SendEmail sendEmailOptions)

Parameters

sendEmailOptions

SendEmail

The SendEmail configuration object that defines email sending capabilities and settings.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Enables users to email reports directly from the viewer interface with customizable email settings.

ServiceUrl(string)

Sets the URL of the Telerik Reporting REST service that will provide the report viewer with reports and handle processing operations.

Declaration

cs-api-definition
IReportViewerBuilder ServiceUrl(string serviceUrl)

Parameters

serviceUrl

string

The complete URL of the properly configured Telerik Reporting REST service endpoint.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

The service must be properly configured for successful communication between the viewer and server.

TemplateUrl(string)

Sets the URL for the custom report viewer template that defines the viewer's UI structure and appearance.

Declaration

cs-api-definition
IReportViewerBuilder TemplateUrl(string templateUrl)

Parameters

templateUrl

string

The URL path to the custom HTML template file for viewer UI customization.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

Allows customization of the viewer interface by providing a custom template with modified functionality or styling.

ViewMode(ViewMode)

Specifies whether the viewer is in interactive or print preview 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
IReportViewerBuilder ViewMode(ViewMode viewMode)

Parameters

viewMode

ViewMode

The ViewMode enumeration value: PrintPreview for paginated print layout, or Interactive for original dimensions with enabled interactivity.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.

Remarks

PrintPreview displays paginated reports as they would appear when printed, while Interactive enables full report interactivity.

ViewMode(ViewModes)

Specifies whether the viewer is in interactive or print preview mode. PRINT_PREVIEW - 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
[Obsolete("Telerik.ReportViewer.Mvc.IReportViewerBuilder.ViewMode(Telerik.ReportViewer.Mvc.ViewModes) is now obsolete. Please use Telerik.ReportViewer.Mvc.IReportViewerBuilder.ViewMode(Telerik.ReportViewer.Mvc.ViewMode) overload instead.")]
IReportViewerBuilder ViewMode(ViewModes viewMode)

Parameters

viewMode

ViewModes

The ViewModes enumeration value specifying the display mode.

Returns

IReportViewerBuilder

The current IReportViewerBuilder instance for method chaining.