1. Home
  2. Docs
  3. Getting Started
  4. Installation
  5. .NET Installation

.NET Installation

Dotnet Report is a powerful reporting and dashboard tool that integrates seamlessly into .NET applications via NuGet. It provides:

  • Dynamic Reporting: Create and manage reports with ease.
  • Dashboard Integration: Build interactive dashboards for data visualization.
  • Customizable: Tailor reports and dashboards to meet specific business needs.
  • Database Connectivity: Connect to various data sources for real-time reporting.

Dotnet Report simplifies the process of adding reporting and dashboards to your .NET applications, making it an ideal choice for developers.

Why Use NuGet Packages?

NuGet is the official package manager for .NET, designed to streamline the integration of third-party libraries and tools into your projects. It allows you to easily install and manage dependencies directly within your Visual Studio project, making development more efficient.

Supported .NET Versions

Dotnet Report supports all versions of .NET and can be installed via different NuGet packages:

Step-by-Step Guide to Integrate Dotnet Report via NuGet

For video tutorials, click here

Prerequisites
  • Download and install Visual Studio.

Step 1: Create a New Project
  1. Open Visual Studio.
  2. Select Create a new project.
  1. Search for the template ASP.NET Core Web App (Model-View-Controller).
  1. Choose a project name and click Next.
  1. Ensure the framework is set to .NET 6,7 or 8
  1. Click Create to generate the project.

Step 2: Install Dotnet Report NuGet Package
  1. Go to the Browse tab and search for Dotnet Report.
  1. Select the package and click Install.

Step 3: Update Project and Copy Files Locally
  1. By default, the Dotnet Report NuGet package adds files as references. To copy them into your project folder:
  2. Edit your project file (.csproj) and add the following line to the Dotnet Report package reference:
<ItemGroup>
    <PackageReference Include="Dotnet Report.core" Version="x.x.x" GeneratePathProperty="true" />
</ItemGroup>

  1. Add the following code to your project file to copy the necessary files:
<PropertyGroup>
<ContentFilesPath>$(PkgDotnet Report_core)\contentFiles\any\any\</ContentFilesPath>
  </PropertyGroup>
  <Target Name="CopyDotnet ReportContent" BeforeTargets="PreBuildEvent">
    <Copy SourceFiles="$(ContentFilesPath)gulpfile.Dotnet Report.js" DestinationFiles="$(ProjectDir)\gulpfile.Dotnet Report.js"></Copy>
<Copy SourceFiles="$(ContentFilesPath)package.Dotnet Report.json" DestinationFiles="$(ProjectDir)\package.Dotnet Report.json"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Content/img/report-logo.png" DestinationFiles="$(ProjectDir)\Content/img/report-logo.png"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Scripts/Dotnet Report.js" DestinationFiles="$(ProjectDir)\Scripts/Dotnet Report.js"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Scripts/Dotnet Report-helper.js" DestinationFiles="$(ProjectDir)\Scripts/Dotnet Report-helper.js"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Scripts/Dotnet Report-setup.js" DestinationFiles="$(ProjectDir)\Scripts/Dotnet Report-setup.js"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Content/Dotnet Report.css" DestinationFiles="$(ProjectDir)\Content/Dotnet Report.css"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Jobs/Dotnet ReportJob.cs" DestinationFiles="$(ProjectDir)Jobs/Dotnet ReportJob.cs"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Models/Dotnet ReportModel.cs" DestinationFiles="$(ProjectDir)Models/Dotnet ReportModel.cs"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Controllers/Dotnet ReportApiController.cs" DestinationFiles="$(ProjectDir)Controllers/Dotnet ReportApiController.cs"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Controllers/Dotnet ReportController.cs" DestinationFiles="$(ProjectDir)Controllers/Dotnet ReportController.cs"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Controllers/DotNetSetupController.cs" DestinationFiles="$(ProjectDir)Controllers/DotNetSetupController.cs"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Views/Dotnet Report/Dashboard.cshtml" DestinationFiles="$(ProjectDir)Views/Dotnet Report/Dashboard.cshtml"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Views/Dotnet Report/Index.cshtml" DestinationFiles="$(ProjectDir)Views/Dotnet Report/Index.cshtml"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Views/Dotnet Report/Report.cshtml" DestinationFiles="$(ProjectDir)Views/Dotnet Report/Report.cshtml"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Views/Dotnet Report/ReportPrint.cshtml" DestinationFiles="$(ProjectDir)Views/Dotnet Report/ReportPrint.cshtml"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Views/DotNetSetup/Index.cshtml" DestinationFiles="$(ProjectDir)Views/DotNetSetup/Index.cshtml"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Views/Shared/_Layout.Report.cshtml" DestinationFiles="$(ProjectDir)Views/Shared/_Layout.Report.cshtml"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Views/Shared/_Dotnet ReportHeaderPartial.cshtml" DestinationFiles="$(ProjectDir)Views/Shared/_Dotnet ReportHeaderPartial.cshtml"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Views/Shared/_Dotnet ReportJsLibrariesPartial.cshtml" DestinationFiles="$(ProjectDir)Views/Shared/_Dotnet ReportJsLibrariesPartial.cshtml"></Copy>
<Copy SourceFiles="$(ContentFilesPath)Views/Shared/_Dotnet ReportTemplatesPartial.cshtml" DestinationFiles="$(ProjectDir)Views/Shared/_Dotnet ReportTemplatesPartial.cshtml"></Copy>
  </Target>

Attached is the before and after code for the project file

  1. Build the project. The files will now be part of your project.
  2. Remove the CopyDotnet ReportContent block from the project file to prevent overwriting.

Step 4: Build Client-Side Libraries
  1. Merge the contents of package.Dotnet Report.json into your project’s package.json file.
  2. Right-click on package.json and select Restore Packages, or run

npm install

  1. Rename gulpfile.Dotnet Report.js to gulpfile.js (if you don’t already have one).
  2. Run the gulp task:
    • Right-click on gulpfile.js in Visual Studio.
    • Select Task Runner Explorer.

Run the scripts task.

Step 5: Update Program.cs or Startup.cs

For .NET 6:
Add the following lines to Program.cs:

Startup.StaticConfig = builder.Configuration; // Add this line manually

JobScheduler.Start(); // Add this line if you want scheduled jobs

For .NET Core:
Add the following lines to Startup.cs:

public Startup(IConfiguration configuration)
{
    Configuration = configuration;
    StaticConfig = configuration; // Add this line manually
}
public static IConfiguration StaticConfig { get; private set; } // Add this line manually

Add NewtonSoft JSON settings (if not already present):

services.AddControllersWithViews()
                .AddNewtonsoftJson(options => options.UseMemberCasing()); // <-- This is important otherwise javascript calls won't work

Step 6: Configure AppSettings.json

Add the following configuration to appsettings.json:

"Dotnet Report": {
    "apiurl": "https://Dotnet Report.com/api",
    "accountApiToken": "Your Account API Key",
    "dataconnectApiToken": "Your Data Connect Key",
    "privateApiToken": "Your Private API Key"
},
"ConnectionStrings": {
    "ConnectionKey": "Data Source=;Initial Catalog=;User ID=;Password=;"
},

If you are using MVC or Web Forms, update the web.config:

<add key="dotNetReport.apiurl" value="https://dotnetreport.com/api" />
<add key="dotNetReport.accountApiToken" value="Your Public Account Api Token" />
<add key="dotNetReport.dataconnectApiToken" value="Your Data Connect Api Token" />
<add key="dotNetReport.privateApiToken" value="Your Private Account Api Token" />
Step 7: Build and Run the Project
  • Build the project to ensure there are no errors.
  • Run the project to verify that Dotnet Report is integrated successfully.

Additional Notes

  • MVC and Web Forms: The integration process is similar for both MVC and Web Forms projects. Ensure the necessary views and controllers are correctly configured.
  • Error Handling: If you encounter errors, verify that all files are copied correctly and that the configuration settings are accurate.

By following this guide, you can seamlessly integrate Dotnet Report into your .NET projects using NuGet, enabling powerful reporting and dashboard capabilities.

Video Tutorials for installation

.NET 6/7/8

.NET 4.x (MVC) and .NET 4.x (Web Forms – ASPX)

How can we help?