Options of the Native Angular Report Viewer
authenticationToken
A bearer token to be added in the Authorization header of each request. Used for authentication with the reporting service.
Type
string
Example
<reporting-angular-viewer
[authenticationToken]="authenticationToken">
</reporting-angular-viewer>
authenticationToken: string = "Bearer your-authentication-token";
contentTabIndex
Sets the tab index for the report viewer content.
Type
number
Default Value
1000
Example
<reporting-angular-viewer
[contentTabIndex]="contentTabIndex">
</reporting-angular-viewer>
contentTabIndex: number = 1500;
documentMapVisible
Controls the visibility of the document map panel if a document map is available.
Type
boolean
Default Value
true
Example
<reporting-angular-viewer
[documentMapVisible]="documentMapVisible">
</reporting-angular-viewer>
documentMapVisible: boolean = false;
enableSendEmail
Enables or disables the send email functionality.
Type
boolean
Default Value
false
Example
<reporting-angular-viewer
[enableSendEmail]="enableSendEmail">
</reporting-angular-viewer>
enableSendEmail: boolean = true;
height
Sets the height of the report viewer container.
Type
string
Default Value
'700px'
Example
<reporting-angular-viewer #viewerId
[height]="height">
</reporting-angular-viewer>
height: string = '600px';
keepClientAlive
Determines whether to keep the client session alive. When true, prevents the session from timing out during long periods of inactivity.
Type
boolean
Default Value
false
Example
<reporting-angular-viewer
[keepClientAlive]="keepClientAlive">
</reporting-angular-viewer>
keepClientAlive: boolean = true;
pageMode
Sets the page display mode of the viewer.
Type
PageMode
Default Value
'continuousScroll'
Example
<reporting-angular-viewer
[pageMode]="pageMode">
</reporting-angular-viewer>
pageMode: PageMode = 'singlePage';
parametersAreaVisible
Controls the visibility of the parameters area if the report has parameters.
Type
boolean
Default Value
true
Example
<reporting-angular-viewer
[parametersAreaVisible]="parametersAreaVisible">
</reporting-angular-viewer>
parametersAreaVisible: boolean = false;
persistSession
Determines whether to persist the viewer session across browser sessions.
Type
boolean
Default Value
false
Example
<reporting-angular-viewer
[persistSession]="persistSession">
</reporting-angular-viewer>
persistSession: boolean = true;
printMode
Sets the print mode for the report viewer.
Type
PrintMode
Default Value
'autoSelect'
Example
<reporting-angular-viewer
[printMode]="printMode">
</reporting-angular-viewer>
printMode: PrintMode = 'forcePDFFile';
reportServer
Configuration for Telerik Report Server connection. The authentication method depends on the Report Server version:
- Report Server for .NET: Supports Token authentication (ReportServerTokenSettings) or username/password authentication (ReportServerSettings). The token can be from any user, including the Guest user.
- Report Server for .NET Framework 4.6.2: Supports username/password authentication (ReportServerSettings) or Guest account (url only with ReportServerSettings, if Guest is enabled on the server).
Required when serviceType is set to 'reportServer'. The ReportServerSettings or ReportServerTokenSettings types should be imported from '@progress/telerik-common-report-viewer'.
ReportServerTokenSettings properties:
- url (string, required) - The URL to the Telerik Report Server instance.
- getPersonalAccessToken (function, required) - A callback function that returns the Token for authentication against the Telerik Report Server for .NET instance wrapped in a Promise. This is the recommended authentication method for Report Server for .NET. The token can be from any user account, including the Guest user. Only supported by Report Server for .NET.
ReportServerSettings properties:
- url (string, required) - The URL to the Telerik Report Server instance.
- username (string, required) - A registered username in the Report Server that will be used to get access to the reports. Supported by both Report Server for .NET and Report Server for .NET Framework 4.6.2.
- password (string, required) - The password for the provided username. Supported by both Report Server for .NET and Report Server for .NET Framework 4.6.2.
Type
any
Example
<!-- Report Server for .NET - Token authentication (recommended) -->
<reporting-angular-viewer
[reportServer]="{
url: 'https://my-report-server-net/',
getPersonalAccessToken: getPersonalAccessToken
}"
[reportSource]="{
report: 'Samples/Dashboard'
}">
</reporting-angular-viewer>
// Report Server for .NET - Token authentication (recommended)
getPersonalAccessToken() {
return Promise.resolve('<personal-access-token>');
}
<!-- Report Server for .NET - Token authentication with secure endpoint -->
<reporting-angular-viewer
[reportServer]="{
url: 'https://my-report-server-net/',
getPersonalAccessToken: getPersonalAccessToken
}"
[reportSource]="{
report: 'Samples/Dashboard'
}">
</reporting-angular-viewer>
// Report Server for .NET - Token authentication with secure endpoint
getPersonalAccessToken() {
return fetch('/rs-token')
.then(response => response.text());
}
<!-- Report Server for .NET - Token authentication with Guest user token -->
<reporting-angular-viewer
[reportServer]="{
url: 'https://my-report-server-net/',
getPersonalAccessToken: getPersonalAccessToken
}"
[reportSource]="{
report: 'Samples/Dashboard'
}">
</reporting-angular-viewer>
// Report Server for .NET - Token authentication with Guest user token
getPersonalAccessToken() {
return Promise.resolve('<guest-user-token>');
}
// Report Server for .NET - Token authentication using ReportServerTokenSettings
import { ReportServerTokenSettings } from '@progress/telerik-common-report-viewer';
reportServer: ReportServerTokenSettings = new ReportServerTokenSettings(
'https://my-report-server-net/',
() => Promise.resolve('<personal-access-token>')
);
<!-- Report Server for .NET - Username/password authentication -->
<reporting-angular-viewer
[reportServer]="{
url: 'https://my-report-server-net/',
username: 'myUser',
password: 'myPassword'
}"
[reportSource]="{
report: 'Samples/Dashboard'
}">
</reporting-angular-viewer>
// Report Server for .NET - Username/password authentication using ReportServerSettings
import { ReportServerSettings } from '@progress/telerik-common-report-viewer';
reportServer: ReportServerSettings = new ReportServerSettings(
'https://my-report-server-net/',
'myUser',
'myPassword'
);
<!-- Report Server for .NET Framework 4.6.2 - Username/password authentication -->
<reporting-angular-viewer
[reportServer]="{
url: 'https://my-report-server-framework/',
username: 'myUser',
password: 'myPassword'
}"
[reportSource]="{
report: 'Samples/Dashboard'
}">
</reporting-angular-viewer>
// Report Server for .NET Framework 4.6.2 - Username/password authentication using ReportServerSettings
import { ReportServerSettings } from '@progress/telerik-common-report-viewer';
reportServer: ReportServerSettings = new ReportServerSettings(
'https://my-report-server-framework/',
'myUser',
'myPassword'
);
<!-- Report Server for .NET Framework 4.6.2 - Guest account (requires Guest enabled on server) -->
<reporting-angular-viewer
[reportServer]="{
url: 'https://my-report-server-framework/'
}"
[reportSource]="{
report: 'Samples/Dashboard'
}">
</reporting-angular-viewer>
// Complete example with Report Server for .NET using Token authentication
import { Component } from '@angular/core';
import { ReportServerTokenSettings, ReportSource } from '@progress/telerik-common-report-viewer';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
reportServer: ReportServerTokenSettings = {
url: 'https://my-report-server-net/',
getPersonalAccessToken: this.getPersonalAccessToken
};
reportSource: ReportSource = {
report: 'Samples/Dashboard',
parameters: {
ReportYear: 2004
}
};
getPersonalAccessToken() {
return Promise.resolve('<personal-access-token>');
}
}
reportSource
Specifies the report and initial report parameter values to be displayed. The report property can be a relative path to a physical file (TRDP/TRDX/TRBP) or an assembly qualified name for type definitions. The ReportSourceOptions type should be imported from '@progress/telerik-common-report-viewer'.
Type
any
Example
<reporting-angular-viewer
[reportSource]="reportSource">
</reporting-angular-viewer>
reportSource: ReportSourceOptions = {
report: 'Dashboard.trdx', // or '{Category}/{ReportName}' when connected to a Report Server
parameters: { ReportYear: 2004 }
};
scale
Sets the scale factor for the report pages. The scale takes effect when the scaleMode is set to 'specific'.
Type
number
Default Value
1.0
Example
<reporting-angular-viewer
[scale]="scale">
</reporting-angular-viewer>
scale: number = 1.5 // 150% scale
scaleMode
Sets how the report pages are scaled.
Type
ScaleMode
Default Value
'specific'
Example
<reporting-angular-viewer
[scaleMode]="scaleMode">
</reporting-angular-viewer>
scaleMode: ScaleMode = 'fitPageWidth';
serviceType
Specifies the type of service that the report viewer will connect to.
Type
ServiceType
Default Value
'REST'
Example
<reporting-angular-viewer
[serviceType]="serviceType">
</reporting-angular-viewer>
serviceType: ServiceType = 'reportServer';
serviceUrl
Sets the address of the Reporting REST Service. Required when serviceType is 'REST'.
Type
string
Example
<reporting-angular-viewer
[serviceUrl]="serviceUrl">
</reporting-angular-viewer>
serviceUrl: string = 'https://demos.telerik.com/reporting/api/reports';
viewMode
Sets the view mode of the report viewer.
Type
ViewMode
Default Value
'interactive'
Example
<reporting-angular-viewer
[viewMode]="viewMode">
</reporting-angular-viewer>
viewMode: ViewMode = 'printPreview';
width
Sets the width of the report viewer container.
Type
string
Default Value
'100%'
Example
<reporting-angular-viewer
[width]="width">
</reporting-angular-viewer>
width: string = '800px';