Add a New Report to an ASP.NET Core Application (CTP)

This tutorial describes how to add a new report to an ASP.NET Core application at the Visual Studio design time.

Prerequisites

Consider the following ASP.NET Core application prerequisites:

  • Install .Net Core 2.1 SDK or later.
  • Install Visual Studio 2017 version 15.7 or later with the following workloads:

    • ASP.NET and web development
    • .NET Core cross-platform development

Create an ASP.NET Core Application

Do the following to create a new ASP.NET Core Web Application in Visual Studio:

  1. Create a new project by selecting File | New | Project in the main menu or pressing CTRL+SHIFT+N.

    create-new-project-vs2017

  2. In the invoked New Project dialog, expand the Installed category, select Visual C#, and then select ASP.NET Core Web Application. Specify the application name and click OK.

    new-project-dialog-asp-net-core-application

  3. Select .Net Framework or .NET Core in the top-left drop-down box. Then select ASP.NET Core 2.0 in the version selector drop-down list. Choose Web Application (Model-View-Controller) and click OK to create the project.

    asp-net-core-application-settings

Add a Report to the ASP.NET Core Application

Do the following to add a report to your ASP.NET Core application:

  1. Start by creating a new folder (named Reports) to store the application's reports. Switch to the Solution Explorer window (by pressing CTRL+ALT+L), right-click the application item and select Add | New Folder.

  2. Right-click the created folder and choose Add | New Item... in the invoked menu.

    asp-net-core-add-new-xtrareport

  3. In the invoked Add New Item dialog, select the Installed | Visual C# | Reporting category and the DevExpress Report (.NET Standard) item template. Specify the report name and click Add.

    asp-net-core-devexpress-template-gallery-add-item-xtrareport

    This adds a blank report template in the XML format to the project (the report layout is stored as an embedded resource in the ASP.NET Core application).

    asp-net-core-added-report

    Double-clicking this file invokes the Report Designer.

    asp-net-core-add-reports-report-designer

    See the First Look at the Report Designer topic to learn about basics of creating reports in Visual Studio.

  4. Specify data connections to design a data-bound report.

    Open the appsettings.json file, add the ConnectionStrings section and specify the required connection strings.

    "ConnectionStrings": {
        "northwind": "XpoProvider=MSSqlServer;Server=localhost;User Id=;Password=;Database=Northwind;Persist Security Info=true"
    }
    

    Invoke the report's smart tag and choose Design in Report Wizard.

    asp-net-core-run-report-wizard

    This runs the Report Wizard, where you can choose to create a data-bound report.

    xtrareport-wizard-empty-report-01

 

Next Step: Create a Simple Data-Aware Report

See Also