New to Telerik Reporting? Download free 30-day trial

Native Blazor Report Viewer Options Overview

Below is a list of all options available during the initialization of the native Blazor Report Viewer.

Options

Property Description
ServiceType

enum, required;

Specifies the type of service that the report viewer will connect to. Available options are:

  • ReportViewerServiceType.REST - Telerik Reporting REST Service
  • ReportViewerServiceType.ReportServer - Telerik Report Server
ServiceUrl

string, required if ServiceType is REST;

Sets the address of the Report REST Service;

ReportSource

ReportSourceOptions, required;

Specifies the report and initial report parameter values to be displayed in the report viewer.

The ReportSourceOptions object is made up of the following properties:

  • Report(string) - Gets or sets a string that uniquely identifies a report from the Reporting REST service or the Telerik Report Server.
  • Parameters(IDictionary<string, object>) - Gets or sets an object with properties name/value equal to the report parameters names and values used in the report definition.

To set the ReportSource to a physical (TRDP/TRDX/TRBP) file, provide a relative path to the Report property of the ReportSourceOptions object.


public ReportSourceOptions ReportSource { get; set; } = new ReportSourceOptions("Report Catalog.trdp", new Dictionary<string, object>
{
    // Add parameters if applicable
});
                

To set the ReportSource to a type definition:

  1. Make sure that the Reporting REST Service project references the project containing the type definition.
  2. Pass the assembly qualified name (format: "{type}, {assembly}") of the report's type to the Report property of the ReportSourceOptions object.

public ReportSourceOptions ReportSource { get; set; } = new ReportSourceOptions("Telerik.Reporting.Examples.CSharp.ReportCatalog, CSharp.ReportLibrary", new Dictionary<string, object>
{
    // Add parameters if applicable
});
                
ReportViewerSettings

RenderFragment, optional

Defines a renderfragment that contains all settings for the Report Viewer.

The currently available settings are:

  • ReportServerSettings - Represents the settings that the report viewer will use to connect to the Telerik Report Server.
    • Url - (string, required) Defines the Url of the report server.
    • Username - (string, required) Defines the Username to be used for authenticating with the report server.
    • Password - (string, required) Defines the Password to be used for authenticating with the report server.
  • SendEmailDialogSettings - Represents the predefined settings for the Send Email dialog.
    • From - (string, optional) E-mail address used for the MailMessage FROM value.
    • To - (string, optional) E-mail address used for the MailMessage TO value.
    • Cc - (string, optional) E-mail address used for the MailMessage Carbon Copy value.
    • Subject - (string, optional) A string used for the MailMessage Subject value.
    • Body - (string, optional) Sentences used for the MailMessage Content value.
    • Format - (string, optional) The preselected report document format.

<ReportViewerSettings>
    <ReportServerSettings Url="https://reportinghost:83" Username="user" Password="pass"></ReportServerSettings>
    <SendEmailDialogSettings From="from@mail.com" To="to@mail.com" Format="CSV"></SendEmailDialogSettings>
</ReportViewerSettings>
                
ScaleMode

enum, optional;

Sets how the report pages to be scaled. Available options are:

  • ScaleMode.FitPageWidth - the pages are scaled proportional to fit the entire width in the viewer's view port;
  • ScaleMode.FitPage- the pages are scaled proportional to fit the entire page in the view port;
  • ScaleMode.Specific - the pages are scaled with the Scale value;
    Default value is: ScaleMode.FitPage
Scale

double, optional;

Sets the scale factor for the report pages. The scale takes effect when the ScaleMode is set to Specific.

Default value is 1.0 (100%); the original size of the report

ViewMode

Sets if the report is displayed in interactive mode or in print preview.

The available values are:

  • ViewMode.Interactive - enables drill-down interactivity, etc;
  • ViewMode.PrintPreview - the report is paged according to the page settings; For more information please see Interactive vs. Print Layout.
    Default value is: ViewMode.Interactive
PageMode

Sets if the report is displayed in Single page or Continuous scroll mode.

The available values are:

  • PageMode.SinglePage - only one page is loaded in the view port;
  • PageMode.ContinuousScroll - more than one page could be loaded in the view port;
    Default value is: PageMode.ContinuousScroll
PrintMode

Specifies how the viewer should print reports.

The available values are:

  • PrintMode.AutoSelect - specifies that the viewer should automatically decide which option for printing to use depending on browser's version and whether the PDF plug-in is available or not. This is the default value;
  • PrintMode.ForcePDFFile - specifies that the document for printing will be downloaded as a file (in PDF format with a special 'print' script enabled);
  • PrintMode.ForcePDFPlugin - specifies that the viewer should always use the PDF plug-in;
ParametersAreaVisible

boolean, optional;

Determines whether the viewer's parameters area is displayed if any parameter editor exists.

Default value: false

DocumentMapVisible

boolean, optional;

Determines whether the viewer's document map is displayed if any bookmark is defined.

Default value: false

KeepClientAlive

boolean, optional;

Determines whether the client will be kept alive. When set to true, expiration of the client will be prevented by continually sending a request to the server, determined by the Reporting REST service's ClientSessionTimeout.

Default value: true

EnableSendEmail

boolean, optional;

Determines whether the Send Email functionality is enabled. If set to false the Send Email button will not be displayed in the toolbar.

Default value: true

Width

string, optional;

The width of the component.

Default value: 100%

Height

string, optional;

The height of the component.

Default value: 700px

Tools

List<IReportViewerTool>, optional;

A collection of tools that will be displayed in the toolbar.

By default populates all available tools as listed in the Customize the Toolbar of the Blazor Native Report Viewer article.

AuthenticationToken

string, optional;

If provided, a Bearer token will be set in the Authorization header for requests to the REST service.

The token is not sent only when requesting document resources. The reason is that the resources like images are referenced with relative URLs in the HTML of the report document, hence the requests for them are made by the browser.

In this article