Enhance Your ASP.NET Core Application with Web Reporting Tools

Enhance Your ASP.NET Core Application with Web Reporting Tools

Table of Contents:

  1. Introduction
  2. Creating ASP.NET Core Web Application
  3. Installing NuGet Packages
  4. Referencing Scripts and Themes
  5. Initializing a Tag Helper
  6. Configuring the Bold Report Script Manager
  7. Adding an Already Created Report
  8. Configuring the Web API
  9. Adding Routing Information
  10. Enabling Cross Origin Requests
  11. Registering the Valid License Token
  12. Setting a Report Path and Service URL
  13. Previewing the Report
  14. Conclusion

Integrating the Bold Reports Report Viewer Component in an ASP.NET Core Application

Introduction

In this article, we will explore the process of integrating the Bold Reports Report Viewer component in an ASP.NET Core application. The Bold Reports Report Viewer is a powerful tool that allows users to display SSRS RDL reports in their web application. By following the steps outlined in this article, You will be able to Create an ASP.NET Core web application and incorporate the Bold Reports Report Viewer to display and Interact with reports.

Creating ASP.NET Core Web Application

To begin, we will create a new ASP.NET Core web application using Visual Studio 2019. We will select the ASP.NET Core version 3.1 and the Web Application (Model-View-Controller) template. This template provides a basic structure for our application and allows us to easily incorporate the Bold Reports Report Viewer.

Installing NuGet Packages

Next, we will install the necessary NuGet packages for our ASP.NET Core application. The required packages include BoldReports.AspNet.Core, BoldReports.Net.Core, and System.Data.SqlClient. These packages provide the functionality needed to process and display the reports in our web application.

Referencing Scripts and Themes

To ensure that our Bold Reports Report Viewer functions correctly, we will need to reference the necessary scripts and themes. In this article, we will be using CDN links to reference these resources. However, you can also use local scripts and themes if desired.

Initializing a Tag Helper

In order to use the Bold Reports Report Viewer component, we will need to initialize a Tag Helper. This will enable us to easily incorporate the report viewer into our views. We can do this by editing the _ViewImports.cshtml file and initializing the report viewer component with Tag Helper support.

Configuring the Bold Report Script Manager

The Bold Reports Report Viewer requires a script manager to properly initialize and render the control. To configure the script manager, we will need to edit the Layout.cshtml file and include the necessary code in the body tag. This will ensure that the report viewer control initialization script is included in the webpage.

Adding an Already Created Report

Once our ASP.NET Core application is set up and the necessary configurations are in place, we can add an already created report to our application. This can be done by creating a folder named Resources in the wwwroot folder of our application and placing the RDL report file in this folder.

Configuring the Web API

The ASP.NET Core report viewer requires a Web API service to process the RDL, RDLC, and SSRS report files. To configure the Web API, we will need to create an API Controller class and implement the necessary methods. These methods handle the processing of the reports and the handling of resource requests from the report viewer control.

Adding Routing Information

To ensure that our HTTP requests are directed to the appropriate controller, we need to add routing information to our application. This can be done by specifying the action parameter in the route template.

Enabling Cross Origin Requests

To allow access to our Web API service from a different domain, we must enable cross origin requests. This is necessary due to browser security preventing the report viewer from making requests to the Web API service when both are run in different domains.

Registering the Valid License Token

To use the Bold Reports Report Viewer in our ASP.NET Core application, we must register a valid license token. This license token can be generated from the download section of the Bold Reports Website. Once generated, we can register the token in the Startup.cs file of our application.

Setting a Report Path and Service URL

To specify the report file and the Web API service URL for the Bold Reports Report Viewer, we need to set the report path and service URL properties. These properties determine where the RDL report is processed and rendered in the browser.

Previewing the Report

Once all the necessary configurations are in place, we can build and run our ASP.NET Core application to preview the report in the Bold Reports Report Viewer. This will allow us to see the sales-order-Detail report loaded and interact with it within our application.

Conclusion

In this article, we have explored the process of integrating the Bold Reports Report Viewer component in an ASP.NET Core application. By following the steps outlined, you can successfully incorporate the Bold Reports Report Viewer into your own ASP.NET Core application and display SSRS RDL reports. The Bold Reports Report Viewer provides a user-friendly interface for interacting with reports and enhances the overall user experience.

Most people like

Find AI tools in Toolify

Join TOOLIFY to find the ai tools

Get started

Sign Up
App rating
4.9
AI Tools
20k+
Trusted Users
5000+
No complicated
No difficulty
Free forever
Browse More Content