DevExpress Reporting in ASP.NET Zero (ASP.NET Core & Angular version)
ASP.NET Zero, with its modular and extensible architecture, provides a solid foundation for developing robust web applications. By combining the capabilities of DevExpress Reporting with ASP.NET Zero, you can effortlessly create and customize visually appealing reports that meet your business requirements.
Server Side
- Download DevExpress Reporting.
- Open your ASP.NET Zero project.
- Import
DevExpress.AspNetCore.Reporting
package to[YOURAPPNAME].Web.Host
project. - Then go to
Startup.cs
and add these code parts:
- Now, you can create a sample report to test if it all works. Go to
[YOURAPPNAME].Web.Host
and create a folder namedReports
. - Right click on the
Reports
folder then clickAdd
->New Item
, then selectDevExpress Report
item. - Select
Blank
report in the opening wizard, and create new empty report named SampleReport.
(Design your report as you wish)
Custom Controllers
DevExpress Reporting has some abstract Controller definitions which we must implement. You can create Controllers below in your *.Web.Host project.
Reports Factory
Create a factory class which provides reports by name ReportsFactory
ReportsFactory.cs
Custom Report Storage Extension
Create a class named CustomReportStorageWebExtension
as seen below
CustomReportStorageWebExtension.cs
Add CustomReportStorageWebExtension
to dependency injection
Client Side
- Go to
package.json
and add following dependencies. (It is located inangular
project) We have used the version23.1.6
which is the latest version when this document is created. You can use the latest version.
Note: Version of the nuget and npm packages should match
- Create a folder named
sample-report
undersrc\app\admin
folder and then create a new component namedsample-report
as shown below.
sample-report.component.html
sample-report.component.ts
Create
sample-report
moduleCreate
sample-report-routing.module.ts
routing moduleAdd sample report route to
admin-routing.module.ts
You can also add sample-report
to navigation menu or you can manually visit http://localhost:4200/app/admin/sample-report