How to configure custom report item extension

To configure a custom report item extension in the Bold Reports® ASP.NET Core Report Viewer, install the extension NuGet package and register its assembly in Startup.cs. The following steps use one-dimensional and two-dimensional barcodes as an example. You can add any other report item by following the same procedure.

Create ASP.NET Core Report Viewer Application

Follow Getting Started with the ASP.NET Core Report Viewer to create an ASP.NET Core Report Viewer application.

How do I install the barcode custom report item extension in the ASP.NET Core Report Viewer?

To install the barcode custom report item extension in the Bold Reports® ASP.NET Core Report Viewer, add the BoldReports.CRI.Barcode NuGet package to the application.

To render and preview one-dimensional and two-dimensional barcodes in the Report Viewer, install the BoldReports.CRI.Barcode package in the application.

Right-click the project or solution in the Solution Explorer tab, and choose Manage NuGet Packages. Alternatively, select the Tools > NuGet Package Manager > Manage NuGet Packages for Solution menu command.

Refer to the NuGet Packages to learn more details about installing and configuring Report Designer NuGet packages.

Search for BoldReports.CRI.Barcode NuGet package, and install it in your application.

Built in data connectors

BoldReports.CRI.Barcode installs into your application. Click OK. The assembly is then added to the respective project references.

Assembly reference

BoldReports.CRI.Barcode NuGet package is available with Bold Reports® release version 3.3 and above. Both one-dimensional and two-dimensional barcodes can be rendered with this single assembly.

Register barcode custom report item extension in application startup

To register the barcode extension in the Report Viewer application, follow these steps.

  1. Open the code-behind file Startup.cs and add the following using statement.

        using BoldReports.Web;
  2. Then add the following code to register extension assembly in Startup method.

        public Startup(IConfiguration configuration, IWebHostEnvironment _hostingEnvironment)
        {
            //Use the below code to register extensions assembly into report designer
            ReportConfig.DefaultSettings = new ReportSettings().RegisterExtensions(new List<string> { "BoldReports.CRI.Barcode" });
    
            Configuration = configuration;
            env = _hostingEnvironment;
        }

To register multiple custom report item extensions in the application, provide the assembly name’s as list of strings. Here both one-dimensional and two-dimensional barcodes rendering can be done with BoldReports.CRI.Barcode assembly, so single assembly name is added in the list.

Run the application

  1. Run the ASP.NET Core Report Viewer Application.

  2. The report renders with the barcode report item.