ActiveReports 17 .NET Edition
Developers / Quick Start
In This Topic
    Quick Start
    In This Topic

    Quickly begin using ActiveReports by following the steps below.

    1. Install ActiveReports.     

    2. In Microsoft Visual Studio 2022 (version 17.0 or above), select ActiveReports 17 JS Viewer Core MVC Application template.
      Create new project in Visual Studio

    3. Type a name for your project and click Create.
      Configure Visual Studio new project

    4. Open the default 'RdlReport1.rdlx' report from the 'Reports' folder and design. You can also add other report types - Page report or Banded Layout report from the templates.
    5. Make sure to set the Build Action property of the report to 'Embedded resource'.
    6. Modify index.html to provide the name of the report you want to preview in viewer.openReport() method:
      viewer.openReport("RdlReport1.rdlx");

    7. Modify Startup.cs to include the path of the folder where the report is kept, for example, if the 'Reports' folder in your application’s root contains the report. The complete Stratup.cs looks like below.

      Startup.cs
      Copy Code
      using GrapeCity.ActiveReports.Aspnetcore.Viewer;
      using Microsoft.AspNetCore.Builder;
      using Microsoft.AspNetCore.Hosting;
      using Microsoft.Extensions.DependencyInjection;
      using Microsoft.Extensions.Hosting;
      using Microsoft.Extensions.Logging;
      using System;
      using System.Reflection;
      using System.Text;
      namespace JSViewerCoreMVCApplication
      {
          public class Startup
          {
              public static string EmbeddedReportsPrefix = "JSViewerCoreMVCApplication.Reports";
              // This method gets called by the runtime. Use this method to add services to the container.
              public void ConfigureServices(IServiceCollection services)
              {
                  Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
                  services
                      .AddLogging(config =>
                      {
                          // Disable the default logging configuration
                          config.ClearProviders();
                          // Enable logging for debug mode only
                          if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == Environments.Development)
                          {
                              config.AddConsole();
                          }
                      })
                      .AddReporting()
                      .AddMvc(option => option.EnableEndpointRouting = false);
              }
              // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
              public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
              {
                  if (env.IsDevelopment())
                  {
                      app.UseDeveloperExceptionPage();
                  }
                  app.UseReporting(settings =>
                  {
                      settings.UseEmbeddedTemplates(EmbeddedReportsPrefix, Assembly.GetAssembly(GetType()));
                      settings.UseCompression = true;
                  });
                  app.UseMvc();
              }
          }
      }
      
           
    8. Run the application. The report opens in the JSViewer.
      Default Run-Time Report