Backend Web/REST API for Reporting with Access Control Rights (Powered by EF Core)
- 3 minutes to read
Your Reporting application may require a report distribution mechanism. A database can store report definitions/templates and users can view or download reports based on permissions. To implement such functionality, you can use DevExpress Web API Service. It allows you to add role-based access control, permission management, and CRUD operations to your next .NET project: DevExpress .NET App Security & Web API Service.
Benefits
- Powered by Entity Framework Core ORM (EF Core)
- DevExpress Web API Service leverages the functionality of EF Core to implement CRUD operations required for your app.
- Multiple Authentication Strategies
- You application’s authentication mechanism can leverage built-in support for OAuth2, JWT, and OpenID. You can also implement a custom authentication strategy.
- Cross-Platform Compatibility
- Backend Web API Service is platform-agnostic. You can access reporting functionality from various types of clients – web, mobile, and desktop applications.
- IDE Integration
- If you work in Visual Studio 2022+ for Windows, integrated Solution Wizard automatically scaffolds your Web Service to speed up application development.
Basic functionality of DevExpress Web API Service is available for free. Additional capabilities and services listed below are available as part of the DevExpress Universal Subscription:
- Audit trail
- Endpoints to download reports and file attachments
- Data validation
- Localization endpoints that return translated captions for UI elements
- Technical support and full source code
Get Started: Add DevExpress Web API Service Funcionality to a Reporting App
Start by designing your reports in Visual Studio. Bind these reports to your EF Core data models / entities. Use built-in API to store report templates in a database. You can then use DevExpress Web API Service to allow permission-based access to reports and EF Core entities. For this purpose, the service includes built-in report endpoints that start with api/Report/
. These endpoints allow users to specify data filters and download documents in PDF, RTF, and other formats.
The following article describes report query syntax supported by DevExpress Web API service: Obtain a Report from a Web API Controller Endpoint.
Review a few endpoint call examples:
- Specify a Filter Condition:
/api/Report/DownloadByName(ReportName)?criteria=[FirstName] = 'Aaron'
- Specify Sort Order:
/api/Report/DownloadByName(ReportName)?sortProperty=[FirstName],Descending
- Pass Report Parameters:
/api/Report/DownloadByKey({key})?FirstName=Mary&Position=Manager
Refer to the following articles for additional information:
- Create Predefined Static Reports
Describes how to create a report suitable for Web API Service data sources bound to your EF Core entities. - Predefined Users, Roles, and Permissions
Describes how to configure permissions for your report container and ORM data models (EF Core entities).
Examples
The following examples use DevExpress Web API Service for user authorization and report access in popular UI frameworks: