Skip to main content

How to Embed Reporting into Your ASP.NET Core Web Applications?

 

Embedded reporting mainly states a method of integrating business intelligence reporting tools like dashboards and charts into a software application. BI is a process of collecting and displaying data in a way that is easy to analyze and digest. The reports cover various aspects of an organization which ranges from sales to marketing and other operations.

BI handles areas of data and analytics, but reporting would focus on presenting the data most easily for better understanding. Embedded reporting would allow multiple users to view those dashboards and data streams that are relevant to use instead of shifting to different dashboards.

How to use Embedded reporting?

One of the common uses of this beautiful reporting tool is in CRM (customer relationship management) suites. The applications are used to increase popular ways of centralizing and optimizing sales and marketing operations. Using BI reports, companies can reduce the time it takes to derive actionable BI insights.

Here in this blog, we’ll learn how to embed beautiful reporting into ASP Net core web applications.

HTML5 Report Viewer

The viewer display report documents on a webpage. They use a custom JQuery based widget, which comes with rich-feature and stateful plugins. The viewer stores the layout in the HTML template, which supports mobile and desktop browsers with full customized methods. HTML viewer includes built-in search functions, hyperlink interaction, and multi-page zoom view support.

Check a few of the HTML5 viewer features

  • The interactive view allows drill-down and drill-through
  • Ability to scale the pages for the best viewing experience
  • Report Parameter intuitive UI for user input
  • Customized layout based on a pure HTML5 template
  • Support mobile as well as desktop browsers
  • Color themes using Kendo UI theming mechanism
  • Scale the pages for best experience including full-page or custom scale factor

What are the system requirements for the HTML5 report viewer?

  • Required Service: The viewer would need a running instance of Telerik Reporting rest service in order to display reports.
  • Required JavaScript Libraries and Files:
  • JQuery minimum required version 1.9.1
  • Kendo UI Professional Q3 2015
  • HTML5 Report Viewer JavaScript
  • Required HTML5 compliant browser

Use HTML5 report viewer with Reporting REST Service

It’s one of the quickest ways to add an HTML5 report viewer to a web project. Here, the viewer won’t be able to process and render work by itself, so it uses the Reporting Rest service. The beautiful reporting services wraps the report engine and expose its functionality over HTTP so the viewer can access it easily. There’s a common scenario used with viewer-service interaction that described with a high-level of abstraction like explained below

HTML5

Image Courtesy: https://www.telerik.com/

  • The viewer requests a report document. It provides report definition with a unique identifier
  • The service search for the requested report definition and guide report engine to process and render in the HTML5 report document
  • Later the service will return the produced result to the viewer
  • Finally, the viewer will display the report document to the user

Host Reporting REST service in your ASP.Net core web Application

Host Reporting REST service in your ASP.Net core web Application

No viewer can function without the service. Let’s assume that the project display report is a service project then uses a separate project with the solution as explained in the below blog. If you don’t have ASP net core web applications, then you can hire ASP.Net core developer or an ASP.Net development company. Or else follow the below steps to create one:

  • Open Visual Studio 2019
  • Now, Open File>New>Project
  • Choose ASP.Net Core Web Application and Press Next
  • Enter your Project name and click to create one
  • Choose .Net Core and ASP.Net Core 3.1 framework.
  • Choose web app template and click on create

Now you can host a reporting rest service by adding NuGet Package. Add own dependencies to project using service packages like Microsoft.AspNet.Core.MVC.NewtonsoftJson.

We can activate NewtonsoftJson services by using the below code:
services.AddRazorPages().AddNewtonsoftJson();

Now add, minimal Reporting Rest service like:

ASP.Net core web Application

Image Courtesy: https://www.telerik.com/

The storage section in the above service specifies internal state objects and temp files.
ReportSourceResolver specifies for report definition inside the Reports application folder.

There is no report folder yet, as we need to add a report, let’s create a folder in the project root named under Reports and copy your report definition file into it.
Configure the API controller inside ConfigureServices method
services.AddControllers();

Now, Map the controller endpoints by adding the code below:

Now, Map the controller endpoints by adding the code below:

Now the next step is to create actual Reportscontroller class
In the root of the project add new controllers’ folder
Select Add>Controller

Choose an API controller with an empty template and click to Add it
Name new controller ReportsController.cs and click on Add

Know how to change the content of the new controller

Know how to change the content of the new controller

Request a Report Document and Display Report Document in HTML5 Report Viewer
In this section, we’ll get to know how to request a report document and display it into the HTML5 report viewer.

Add custom section like the head element of the Layout page

<head>

@RenderSection(“Head”, required: false)
</head>

So now, inside pages/Index.cshtml add div element to hold the viewer. The element inside it comes with unique id. Set it with CSS file, inline style dimension

<div id=”reportViewer1″ style=”width:840px; height:1200px”>
</div>

Later, add a link to section head to the desired Kendo UI theme in custom head and finally to the viewer widget’s JavaScript file by calling the Telerik_ReportViewer method.

Telerik_ReportViewer method.

Understand below Scripts section which helps to insert viewer script after JQuery

Understand below Scripts section which helps to insert viewer script after JQuery

Check the final Index.cshtml file

Check the final Index.cshtml file

Now press F5 in visual studio and check HTML5 Report Viewer. The service instructs Report Engine to render the report definition in HTML5 form and return it to the viewer as a report document.

Check final output

Check final output

Image Courtesy: https://www.telerik.com/

If you want to check the errors, then press F12 in the browser and log the network traffic. If you want to hire ASP.NET Core Developer or looking for ASP.NET Development Company connect with us to discuss your requirements.

Comments

Popular posts from this blog

How Much Does It Cost To Hire An App Developer In 2019?

It is considered a very important question that how much it effectively costs for the purpose of hiring an app developer and that too in the year 2019. Nowadays, due to the rising trend, it is very important to hire iPhone developer. Also, it seems that each business, as well as every brand, has its own app in the year 2019. In that way, you can also hire iPhone app developer India. Even, there are many of the local coffee shops which possess an app for the purpose of ordering a frappuccino available at your doorstep or you can collect it on discounts. For developing these apps, sometimes it becomes very important to preferably hire iPhone programmer. There is a gradual presence of many of the IT entrepreneur who is usually making a fortune from a hit app. So, here are given some of the ever-actual issues of how to  hire iPhone app developer  for the development purpose. We will preferably talk about some of the important as well as general tips which can prove helpful to hire io

Engagement Models For Laravel Application Development

  In the mobile app, the development backend holds prime importance. It has a trusted and dependable technology that would take good care of your backend operations with ease. For this purpose, Laravel creator said, “we want to simplify the development process”. Today the Laravel 5.4 is the latest released version that enforces the same ideology with new features. Leverage the best Laravel application development service & create a well-tailored web app. Hire a Laravel development company to scale business growth. Laravel provides predefined architecture and customized backend logic to stand out differently from the crowd. Hire Laravel developers in India and choose the company that understands your needs. We are one of the best leading web application development companies in India. We offer a wide range of engagement models that suits our customer’s needs. Let’s dive into understanding the engagement models in a better way. What are engagement models? An engagement model is a

5 Features while Developing On-Demand ‘Mover n Packers’ App like Uber Movers

Peeping into a few years back, though there were mobiles trending, mobile apps were more limited towards messaging and gaming, but a year or two year back scenario depicts a different story in all. On-demand applications that can be for Food or say Cab Booking or for Salon or for the  Guard booking app  for the event, anything, and everything can be covered in the app itself. UBER is considered more of as a BRAND instead of just an app to book the cab. It has widespread its scope beyond the app in various fields across the globe. Along with the services of moving human from one destination to another, not just limiting to that, Uber is even into Movers and Packers, namely Uber Movers. According to the report, “UberMovers provides free and professional moving services for up to ½ an hour for students in Atlanta between 9 a.m. to 2 p.m. on Saturdays only”. Similar moving services, it provides in Nashville even. Eventually, it is spreading its wings further too. Are you the one prov