How to configure a custom report item extension
To add a custom report item to the Bold Reports® JavaScript Report Designer, refer its scripts in the HTML page, set the reportItemExtensions API, install its extension NuGet package, and register the extension assembly in Application_Start. The following steps use one-dimensional and two-dimensional barcodes as an example, and you can add any other report item by following the same procedure.
Create Report Designer JavaScript application
To create a Report Designer JavaScript application, follow Getting started.
Adding barcode under designer item panel
Refer the barcode scripts and CSS in the head section of the sample HTML file.
Note: You can get the sample script and css for one-dimensional and two-dimensional barcode report items from the installed location:
{Installed_location}\Samples\Common\Javascript\assets\scripts\extension

You can also install the BoldReports.JavaScript.Extensions NuGet package to get the one-dimensional and two-dimensional barcode report items scripts.
Configure to get the one-dimensional and two-dimensional barcode report items using the reportItemExtensions API while initializing the Report Designer.
<div style="height: 600px; width: 950px; min-height: 400px;" id="designer"></div>
<script type="text/javascript">
$(function () {
$("#designer").boldReportDesigner({
serviceUrl: "/api/ReportingAPI",
reportItemExtensions: [{
name: 'barcode',
className: 'EJBarcode',
imageClass: 'customitem-barcode',
displayName: '1D Barcode',
category: 'Barcodes'
},
{
name: 'matrixbarcode',
className: 'EJQRBarcode',
imageClass: 'customitem-qrbarcode',
displayName: '2D Barcode',
category: 'Barcodes'
}]
});
});
</script>The one-dimensional and two-dimensional barcodes now appear under the item panel of the Report Designer.
How do I install the barcode custom report item extension for the JavaScript Report Designer?
To render the one-dimensional and two-dimensional barcodes in the Report Designer and preview, 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 the BoldReports.CRI.Barcode NuGet package, and install it in your application.

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

BoldReports.CRI.Barcode NuGet package is available with Bold Reports® release versions 3.3 and above. Both one-dimensional and two-dimensional barcodes can be rendered with this single assembly.
How do I register the barcode custom report item extension in the JavaScript Report Designer?
To register the barcode extension in the Report Designer application, follow these steps.
-
Open the code-behind file
Global.asax.csand add the following using statement.using BoldReports.Web; -
Register the assembly name of the required extension in Application_Start as follows:
protected void Application_Start(object sender, EventArgs e) { System.Web.Http.GlobalConfiguration.Configuration.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional }); AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true); //Use the below code to register extensions assembly into report designer ReportConfig.DefaultSettings = new ReportSettings().RegisterExtensions(new List<string> { "BoldReports.CRI.Barcode" }); }
To register multiple custom report item extensions in the application, provide the assembly names as a list of strings. Here both one-dimensional and two-dimensional barcode rendering can be done with BoldReports.CRI.Barcode assembly, so a single assembly name is added to the list.
Build and run the application. You can now render barcodes in the Report Designer and preview. To design barcode reports in the Report Designer, see Barcode report item.
