Articles in this section

How to Use Offline Scripts and Styles Instead of CDN Links in Bold Reports

Published:
Updated:

Bold Reports provides the option to use local (offline) client scripts and stylesheets instead of Content Delivery Network (CDN) links. Using offline assets allows your application to function reliably in restricted intranet environments, isolated virtual networks, or environments without internet access. Follow the steps below to configure offline scripts in your application.

Step 1: Download the Matching Offline Package

  1. Navigate to NuGet to access the client assets package:
  2. In the Versions tab, select the version that matches your project’s Bold Reports backend package version.
  3. Click Download package on the right-hand panel to save the .nupkg file locally.
  4. Rename the downloaded file extension from .nupkg to .zip (e.g., boldreports.javascript.x.x.x.zip).
  5. Extract the .zip archive to a local folder.

Step 2: Add Scripts and Styles to the Application

  1. Open the extracted folder and locate the Content and Scripts directories.

  2. Copy these folders and paste them into your project’s static assets location and place them inside the wwwroot folder (e.g., wwwroot/Content and wwwroot/Scripts).

    image.png

    image.png

Step 3: Replace CDN Links with Local References

Open the _Layout.cshtml file or the page where Bold Reports resources are referenced. Locate the existing Bold Reports CDN references and replace them with the corresponding local file references from the Content and Scripts folders.

Before (Using External CDN Links):

<head>
    <!-- Report Viewer component style -->
    <link href="https://cdn.boldreports.com/15.1.11/content/v2.0/tailwind-light/bold.report-viewer.min.css" rel="stylesheet" />
    
    <!-- Report Viewer component dependent scripts -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script src="https://cdn.boldreports.com/15.1.11/scripts/v2.0/common/bold.reports.common.min.js"></script>
    <script src="https://cdn.boldreports.com/15.1.11/scripts/v2.0/common/bold.reports.widgets.min.js"></script>
    
    <!-- Report Viewer component script -->
    <script src="https://cdn.boldreports.com/15.1.11/scripts/v2.0/bold.report-viewer.min.js"></script>
</head>

After (Using Local Offline Assets):

<head>
    <!-- Report Viewer component style -->
    <link href="~/content/bold-reports/v2.0/tailwind-light/bold.report-viewer.min.css" rel="stylesheet" />

    <!-- Report Viewer component dependent scripts -->
    <script src="~/lib/jquery/dist/jquery.min.js"></script>
    <script src="~/scripts/bold-reports/v2.0/common/bold.reports.common.min.js"></script>
    <script src="~/scripts/bold-reports/v2.0/common/bold.reports.widgets.min.js"></script>
    
    <!-- Report Viewer component script -->
    <script src="~/scripts/bold-reports/v2.0/bold.report-viewer.min.js"></script>
</head>

image.png

Note: Bold Reports periodically releases updates, enhancements, and bug fixes. To benefit from these improvements, update the offline scripts whenever you upgrade your Bold Reports version.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied