Progress® Telerik® Reporting R3 2017

How To: Construct a string to connect to Report Engine

When using WinForms or WPF Report Viewer, its connection to a Report Server or REST service instance should be additionally set. This topic lists the supported keywords for each report engine type and explains how to construct a connection string with or without using helper classes.

All the keywords and their values are case insensitive where applicable.

Embedded Report Engine

Keyword

Value

Engine

Embedded

Example: engine=embedded

You can use a EmbeddedConnectionInfo instance to help you create the connection string or leave it empty - the viewer will use the embedded report engine by default.

Example

private void SetEmbeddedReportEngineConnection(object sender, System.EventArgs e)
{
    this.reportViewer1.ReportEngineConnection = new Telerik.ReportViewer.Common.EmbeddedConnectionInfo().ConnectionString;
    //if the ReportEngineConnection property is set to null or empty string, it will use the EmbeddedConnectionInfo by default. 
}

Report Server Engine

Keyword

Value

Engine

ReportServer

Uri

required; The URI of the Report Server instance

Username

optional; The user name used to connect to Report Server. If omitted, the Guest account will be used, if it is enabled.

Password

optional; The password associated with the user name.

Example: engine=ReportServer;uri=http://localhost:83;username=admin;password=pass

You can use a ReportServerConnectionInfo instance to help you create the connection string.

Example

private void SetReportServerReportEngineConnection(object sender, System.EventArgs e)
{
    this.reportViewer1.ReportEngineConnection = new Telerik.ReportViewer.Common.ReportServerConnectionInfo("http://reportserver:83", "user", "pass").ConnectionString;
}

REST Service Engine

Keyword

Value

Engine

RestService

Uri

required; The URI of the REST Service instance.

Token

optional; If provided, a Bearer token will be set in the Authorization header for every request to the REST service.

UseDefaultCredentials

optional, True/False; If provided, the client will send the default credentials with its requests. The default value is False.

Example: engine=RestService;uri=http://localhost:18103/api/reports;token=authToken;useDefaultCredentials=true

You can use a RestServiceConnectionInfo instance to help you create the connection string.

Example

private void SetRestServiceReportEngineConnection(object sender, System.EventArgs e)
{
    this.reportViewer1.ReportEngineConnection = new Telerik.ReportViewer.Common.RestServiceConnectionInfo("http://servicehost:83/api/reports", "authToken").ConnectionString;
}

See Also