logo
small logo
  • Products
  • Buy
  • Support
  • About
  • Customer panel Support
    • en
    • de
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • How to generate a report from an ASP.NET Core application using FastReport.Core.Skia
  • Working with NuGet packages in FastReport

    November 22, 2021

    UPD: Applies to the versions of FastReport .NET before 2022.2. License packages are now available

    read more
  • FastReport .NET packages and .NET 5.0

    December 17, 2020

    UPD: Applies to the versions of FastReport .NET before 2022.2. License packages are now available

    read more
  • Reporting with PostgreSQL in a .NET 5 application for Debian 10

    May 25, 2022

    Many need a solution that will generate reports for Linux systems, and support working

    read more
  • Building libgdiplus library from source

    October 2, 2020

    When using the FastReport.NET (Core), FastReport Open Source and FastReport Mono libraries on Linux operating

    read more
  • How to host FastReport ASP .NET Core application in IIS Windows Server 2012

    September 28, 2021

    To host the created applications on Internet servers, you need a web server. Today we

    read more

How to generate a report from an ASP.NET Core application using FastReport.Core.Skia

October 4, 2023

How to generate a report from an ASP.NET Core application using FastReport.Core.Skia

Previously, we told you how to generate a report from an ASP.NET Core application, but not all users use Windows OS or the GDI+ graphics engine (due to unstable operation). Especially for these users, we have developed a special version of FastReport.Core, which uses Skia as a graphics engine and its wrapper for .NET - SkiaSharp. Full package name— FastReport.Core.Skia. The FastReport.Core.Skia and FastReport.Web.Skia packages are available on our private NuGet server.

The main advantages of FastReport.Core.Skia include:

  • Correct PDF export of RTL-text on Linux;
  • Correct PDF export of some Eastern languages on Linux;
  • Correct HTML export on Linux.

You can also learn more about the benefits of FastReport.Skia in this article.

Creating a report and application on Windows

The process of creating a report will be simple. We need to create a report in the designer and run it in an ASP.NET Core application. As an example, we use the standard and familiar template “Simple List.”

Selecting a standard report template

At this stage, we have a ready-made template. Now it needs to be displayed on the Web Preview via the ASP.NET Core application. Let's start creating the application.

Creating ASP.NET Core applications

 

Selecting advanced options

As a result, we successfully created the project. The next step is to add the necessary nuget packages, namely FastReport.Core.Skia and FastReport.Web.Skia. This article uses a method for connecting packages from a private NuGet server.

Connecting packages from a private NuGet server

The necessary packages have been installed. Now let's connect FastReport in the Program.cs file.

var builder = WebApplication.CreateBuilder(args);
…
app.UseFastReport();
…
app.Run();

The next step is to edit the Index() method in HomeController.cs. 

public IActionResult Index()
 {
 var report = new WebReport();
 var data = new DataSet();
 data.ReadXml($"C:/Users/User/Documents/nwind.xml"); 
 report.Report.RegisterData(data);
 report.Report.Load($"C:/Users/User/Documents/Simple List.frx");
 ViewBag.WebReport = report;
 return View();
 }

Now we need to configure the view. To do this, you need to leave the following code in the index.cshtml file.

@await ViewBag.WebReport.Render()

Our application is ready! We can run it and look at the result.

Ready report

As you may have noticed, creating a project is almost no different compared to the FastReport.Core package. All you have to do is download another NuGet package.

 

Creating a report and application on Linux

Let's now create an ASP project on Linux and display the report in it.

Attention! Make sure that you have downloaded the necessary packages for your .NET projects to work and installed at least VSCode. Also, you need to configure VSCode itself, namely installing an extension for C# and connecting a private NuGet server.

After downloading .NET and installing VSCode, we create a project. The next step is to connect the NuGet packages FastReport.CoreSkia and FastReport.Web.Skia. Unlike Windows, we will also need 2 other Skia packages: SkiaSharp.NativeAssets.Linux and HarfBuzzSharp.NativeAssets.Linux. This is what the list of installed NuGet packages should look like.

List of installed NuGet packages

The packages have been installed, now let's run the project. To get started, enter the command:

dotnet build

Then enter the following command:

dotnet run

Running commands to work with a project

Follow the local link and check the report in the browser.

Ready report in the browser

The process of creating a project using FastReport.Core.Skia is quite simple and, to some extent, “traditional.” We just need to connect additional packages for Linux. In return, you get an improved display of some texts and characters from Eastern languages in exports that you may have encountered when using GDI+. Also, we recommend using the Skia rendering engine if you are a Linux user.

about product buy
avatar
German Bagaevski
QA
Fast Reports Team: German Bagaevski - Quality Assurance at Fast Reports
.NET Visual Studio FastReport Linux Core Report NuGet Windows

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • FAQ
  • Tutorial Video
  • Forum
  • Support SLA
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Partner program
  • Contact us

© 1998-2023 by Fast Reports Inc.

  • Privacy Policy
  • Cookies Policy

Trustpilot
By clicking “Accept all, you agree Fast Reports can store cookies on your device and disclose information in accordance with our Cookie Policy.