Options Overview
Below is a list of all options available during initialization.
How to configure the options
The options can be set from the .HTML
/.TS
component file or both(combined):
<tr-viewer #viewer1
[containerStyle]="viewerContainerStyle"
[serviceUrl]="'http://localhost:59655/api/reports/'"
[reportSource]="{
report: 'Report2.trdp',
parameters: {}
}"
[viewMode]="'INTERACTIVE'" [scaleMode]="'SPECIFIC'" [scale]="1.0" [ready]="ready"
[viewerToolTipOpening]="viewerToolTipOpening" [enableAccessibility]="false">
</tr-viewer>
export class ReportViewerComponent implements AfterViewInit {
@ViewChild('viewer1') viewer: TelerikReportViewerComponent;
...
title = "Report Viewer";
viewerContainerStyle = {
position: 'absolute',
left: '5px',
right: '5px',
top: '40px',
bottom: '5px',
overflow: 'hidden',
clear: 'both',
['font-family']: 'ms sans serif'
};
ready() {
console.log('ready');
}
viewerToolTipOpening(e: any, args: any) {
console.log('viewerToolTipOpening ' + args.toolTip.text);
}
}
Available Options
Parameter | Description | ||||
---|---|---|---|---|---|
id | string, optional; Sets the unique identifier of the ReportViewer instance. If not specified, the id of the target HTML element will be used (if such is set). The id of the ReportViewer is used to identify the client session of the viewer when persistSession is enabled (true); | ||||
serviceUrl | string, required if; Sets the address of the Report REST Service; | ||||
reportServer |
JSON, required if; Sets the configuration details for Telerik Report Server. Available properties:
|
||||
templateUrl | string, optional; Sets the address of the html page that contains the viewer templates; If omitted, the default template will be downloaded from the REST service. | ||||
reportSource |
JSON, optional; Sets the report and initial report parameter values for the viewer to be displayed. Available properties:
|
||||
sendEmail |
object, required to show the; Available properties:
|
||||
scale |
number, optional; Sets the scale factor for the report pages. The scale takes effect when scaleMode is set to “SPECIFIC”. Default value is 1.0 (100%); |
||||
scaleMode |
string, optional; Sets how the report pages to be scaled. Available options are:
|
||||
viewMode |
string, optional; Sets if the report is displayed in interactive mode or in print preview. The available values are:
|
||||
pageMode |
string, optional; Sets if the report is displayed in Single page or Continuous scroll mode. The available values are:
|
||||
persistSession |
boolean, optional. Sets whether the viewer’s client session to be persisted between the page’s refreshes(ex. postback). The session is stored in the browser’s sessionStorage and is available for the duration of the page session. A page session lasts for as long as the browser is open and survives over page reloads and restores. Opening a page in a new tab or window will cause a new session to be initiated. The viewer’s state is persisted in the global sessionStorage object under a key defined by the viewer’s id. In order to enable the correct session to be loaded on the next page reload please use the same id as in the first load. This means that if you need to persist the client session between page reloads you should set the viewer’s id (or the id of the target element) to a constant value that should not be changed dynamically during the page lifecycle. Default Value is: false; |
||||
parameters |
object, optional; Allows the user to define parameter options for the report parameters.
|
||||
parameterEditors | array, optional; Allows the user to define custom editors for the report parameters. | ||||
authenticationToken | string, optional; If provided, a Bearer token will be set in the Authorization header for every request to the REST service. | ||||
printMode |
string, optional. Specifies how the viewer should print reports. The available values are:
|
||||
selector | string, optional. A selector used in conjunction with the data attributes. Whenever a command is attached to an element outside of the report viewer via the data-attributes this selector must be provided. | ||||
disabledButtonClass | string, optional. A class used in conjunction with the data- attributes. Whenever a command is in the disabled state this class will be added to the respective button. | ||||
checkedButtonClass | string, optional. A class used in conjunction with the data- attributes. Whenever a command is in the checked state this class will be added to the respective button. | ||||
enableAccessibility |
boolean, optional. Determines whether the viewer should provide support for accessibility features. You can find more detailed information here. Default value: false; |
||||
parametersAreaVisible | boolean | ||||
documentMapVisible | boolean | ||||
parametersAreaPosition |
string, optional. Specifies where the Parameters Area should be displayed The available values are:
|
||||
documentMapAreaPosition |
string, optional. Specifies where the Document Map should be displayed The available values are:
|
||||
searchMetadataOnDemand |
boolean, optional. Determines whether the search metadata will be delivered on demand (true) or by default (false). Default value: false; |
||||
initialPageAreaImageUrl | string, optional. The image URL for the PageArea background image. Used only when the parameter values are missing or invalid. The image should be in PNG, GIF, or JPG file format. | ||||
keepClientAlive | boolean |