Skip to content

How to use the DevExpress.Drawing package based on the SkiaSharp library in an ASP.NET Core DevExpress Reporting application.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/reporting-use-devexpress-drawing-skia-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reporting for ASP.NET Core - How to Use the SkiaSharp-Based DevExpress Drawing Engine

This example demonstrates how to use the DevExpress.Drawing package based on the SkiaSharp library instead of the System.Drawing library in an ASP.NET Core application to preview, print, or export DevExpress XtraReports.

The commands required to configure the host operating system environment for the DevExpress Drawing Engine are included in the docker file.

How to Build and Run this Example

Specify the NuGet Feed URL for Docker

To restore NuGet packages while building a Docker image, you should pass the DevExpress NuGet feed URL as a secret as follows:

  1. Go to nuget.devexpress.com and copy your DevExpress NuGet feed URL.
  2. Paste the copied feed URL to the secrets.dev.yaml file located in the project.

Run the Example

Visual Studio

You can run the app on the Windows platform, or the Windows Subsystem for Linux or Docker. If you want to launch the app with docker, select Docker from the Launch drop-down menu in the Visual Studio toolbar.

CLI

Run the application from the dotnet CLI on Windows, Linux, and MacOS with the following command:

dotnet run

To run the Docker container from the command line, build the Docker image:

Windows

cd ReportingWebApp
docker build -t reporting-app --secret id=dxnuget,source=secrets.dev.yaml .
docker run -p 8080:80 reporting-app:latest

Linux

cd ReportingWebApp
DOCKER_BUILDKIT=1 docker build -t reporting-app --secret id=dxnuget,source=secrets.dev.yaml .
docker run -p 8080:80 reporting-app:latest

The application page is available at the following URL: http://localhost:8080/.

Review the Docker documentation for more information: BuildKit documentation.

If your secrets.dev.yaml contains the byte order mark (BOM), you can get an error while restoring NuGet packages. To avoid this potential problem, make sure your secrets.dev.yaml encoding does not contain the BOM.

Files to Review

  • Startup.cs

    At startup, call the DevExpress.Drawing.Internal.DXDrawingEngine.ForceSkia method to use the DevExpress Drawing Skia engine in the application.

  • secrets.dev.yaml

    The file that contains your NuGet feed URL.

  • ReportingWebApp.csproj

    The DockerfileFile property in the project file specifies the name of the docker file to use in the project. Sample docker files for different operating systems are included in the project. You should edit the project file manually to replace the default Debian docker file with docker files for Alpine, Ubuntu or Amazon Linux. For more information on build properties in a project file, review the following help topic: Container Tools build properties.

  • Dockerfile

    The Debian docker file.

  • Dockerfile.Alpine

    The Alpine docker file.

  • Dockerfile.Ubuntu

    The Ubuntu docker file.

  • Dockerfile.AmazonLinux

    The Amazon Linux docker file.

  • Dockerfile.OpenSuse

    The OpenSuse docker file.

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

How to use the DevExpress.Drawing package based on the SkiaSharp library in an ASP.NET Core DevExpress Reporting application.

Topics

Resources

License

Stars

Watchers

Forks