Radzen Blazor Components

SSRS Viewer

RadzenSSRSViewer displays a report created in SQL Server Reporting Services (SSRS).

info
There is no live demo of RadzenSSRSViewer because hosting a public SSRS server is not a trivial task.

To display a report you should specify:

  1. The name of the report via the ReportName property.
  2. The URL of your report server via the ReportServer property.
Here is a minimal example:

<RadzenSSRSViewer ReportName="Untitled" ReportServer="http://myserver/ReportServer/" />

Parameterslink

Often SSRS reports have parameters. You can specify those via the Parameters collection:


<RadzenSSRSViewer ReportName="Untitled" ReportServer="http://myserver/ReportServer/">
  <Parameters>
    <RadzenSSRSViewerParameter ParameterName="Param1" Value="1" />
    <RadzenSSRSViewerParameter ParameterName="Param2" Value="2" />
  </Parameters>
</RadzenSSRSViewer>

Proxylink

Often your report server won't be exposed to the public Internet or you would want to either hide report parameters or provide security credentials. In this case you can use the built-in proxy support in RadzenSSRSViewer. To enable it set the UseProxy property to trueand add the ReportController class below to your Blazor application.


<RadzenSSRSViewer UseProxy="true" ReportName="Untitled" ReportServer="http://myserver/ReportServer/">
  <Parameters>
    <RadzenSSRSViewerParameter ParameterName="Param1" Value="1" />
    <RadzenSSRSViewerParameter ParameterName="Param2" Value="2" />
  </Parameters>
</RadzenSSRSViewer>

Provide credentialslink

To provide user credentials when making the proxy requests you can implement the OnHttpClientHandlerCreate partial method of ReportController.

  1. Add a new file e.g. ReportController.Credentials.cs
  2. Implement the OnHttpClientHandlerCreate partial method:
    
    using System.Net;
    using System.Text;
    using Microsoft.AspNetCore.Http.Extensions;
    using Microsoft.AspNetCore.Mvc;
    public namespace YourAppNamespace.Controllers
    {
       public partial class ReportController
       {
           void OnHttpClientHandlerCreate(ref httpClientHandler);
           {
             httpClientHandler.Credentials = new NetworkCredential("username", "password", "domain");
           }
       }
    }
    

Alternatively you can set the Credentials property of httpClientHandler directly in the CreateHttpClient method of the ReportController class:


private HttpClient CreateHttpClient()
{
    var httpClientHandler = new HttpClientHandler();

    httpClientHandler.AllowAutoRedirect = true;
    httpClientHandler.UseDefaultCredentials = true;

    // Set the credentials
    httpClientHandler.Credentials = new NetworkCredential("username", "password", "domain");

    if (httpClientHandler.SupportsAutomaticDecompression)
    {
        httpClientHandler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
    }

    OnHttpClientHandlerCreate(ref httpClientHandler);

    return new HttpClient(httpClientHandler);
}

In some setups authenticating the request like this could fail with exceptions such as:

  • HttpRequestException: Authentication failed because the connection could not be reused.. If this happens check this forum thread
  • System.ComponentModel.Win32Exception (0x80090302): The function requested is not supported. If this happens check this forum thread

Supercharge your Blazor development with Radzen Blazor Studio

Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

open_in_new Learn More
>Radzen Blazor Studio

Radzen Blazor Components, © 2018-2024 Radzen.
Source Code licensed under MIT

Demos Configuration

Premium Themes

  • Material 3
  • Material 3 Dark
  • Fluent
  • Fluent Dark

Free Themes

  • Material
  • Material Dark
  • Standard
  • Standard Dark
  • Default
  • Dark
  • Humanistic
  • Humanistic Dark
  • Software
  • Software Dark
An error has occurred. This app may no longer respond until reloaded. Reload 🗙