Use Visual Studio Templates to Create an Angular Application with a Document Viewer
- 2 minutes to read
This document describes how to use the DevExpress Template Gallery to generate a Single-Page Application (SPA) with the following projects:
- An ASP.NET Core project that works as an API backend
- An Angular project that works as a UI and contains the Document Viewer control.
Use the DevExpress Template Gallery
The DevExpress Template Gallery implements a step-by-step process that allows you to create an ASP.NET Core application with a Document Viewer.
The created application includes a sample report storage that allows users to open report layout files (REPX) from the Reports folder and instances of report types predefined in the assembly.
Follow the steps below to create an ASP.NET Core application in Visual Studio:
Select FILE | New | Project in the main menu or press CTRL+SHIFT+N to create a new project.
Select the DevExpress v23.1 Web App Template Gallery, and click Next:
Specify a project name and location, and click Create:
Select Reporting Angular Application from the .NET 6 category in the invoked DevExpress Template Gallery.
Select a framework version and click Create Project.
Enable the Add Viewer Page checkbox in the invoked DevExpress ASP.NET MVC Project Wizard to add the Document Viewer to the web application (the report-viewer.html file). You can add a Web Document Viewer and a Report Designer to the application.
Use the following Document Viewer settings:
- Report Storage Name - the server-side report storage‘s class name.
- Data Binding Mode - switches between the Expressions and Expressions (Advanced) modes that specify how data is fetched to reports and controls. See Data Binding Modes for more information.
Click Create Project to apply these settings to the project.
Optional. You can configure the Document Viewer to load a report when the application starts. Navigate to the ClientApp | src | app | report-viewer | report-viewer.ts file and replace the built-in report name with the name of your report:
reportUrl: string = "TestReport";
Run the project to see the result: