FlexiReport 9.0.1
dotnet add package FlexiReport --version 9.0.1
NuGet\Install-Package FlexiReport -Version 9.0.1
<PackageReference Include="FlexiReport" Version="9.0.1" />
<PackageVersion Include="FlexiReport" Version="9.0.1" />
<PackageReference Include="FlexiReport" />
paket add FlexiReport --version 9.0.1
#r "nuget: FlexiReport, 9.0.1"
#addin nuget:?package=FlexiReport&version=9.0.1
#tool nuget:?package=FlexiReport&version=9.0.1
Flexi Report - Backend Library
This library is designed to support the backend functionalities required by the Flexi Report Angular library.
📌 Features
- Report Management: Create, edit, and manage reports.
- Dynamic SQL Queries: Retrieve data from the database with dynamic queries.
- Database Schema Retrieval: List tables and columns from the database.
- Flexible and Customizable: Supports dynamic components generated on the UI side.
🚀 Installation
To add this package to your project, run:
dotnet add package FlexiReport
📖 Usage
1️⃣ Retrieve Database Schema
Retrieve all tables and columns from the connected database:
public async Task<List<DatabaseSchemaDto>> GetDatabaseSchemaAsync(DbContext dbContext, CancellationToken cancellationToken = default)
Example Usage:
var schema = await flexiReportService.GetDatabaseSchemaAsync(dbContext);
2️⃣ Execute SQL Query
Only SELECT
queries are allowed.
public async Task<Result<object>> ExecuteQueryAsync(QueryRequestDto request, DbContext dbContext, CancellationToken cancellationToken = default)
Example Usage:
var request = new QueryRequestDto("SELECT * FROM Users");
var result = await flexiReportService.ExecuteQueryAsync(request, dbContext);
3️⃣ Report Model
The Report
model contains the following properties:
public sealed class Report
{
public Guid Id { get; set; }
public string Content { get; set; }
public DateTime CreatedAt { get; set; }
public string Endpoint { get; set; }
public string Name { get; set; }
public string PageSize { get; set; }
public string PageOrientation { get; set; }
public string FontFamily { get; set; }
public string SqlQuery { get; set; }
public string BackgroundColor { get; set; }
public List<RequestElement>? RequestElements { get; set; }
}
4️⃣ API Integration
To integrate with the frontend, use the following API structure:
[HttpPost("execute-query")]
public async Task<IActionResult> ExecuteQuery([FromBody] QueryRequestDto request)
{
var result = await _flexiReportService.ExecuteQueryAsync(request, _dbContext);
return result.IsSuccess ? Ok(result.Value) : BadRequest(result.Error);
}
📌 DTO Models
QueryRequestDto
public sealed record QueryRequestDto(
string SqlQuery);
ReportDto
public sealed record ReportDto(
Guid? Id,
string Content,
string Endpoint,
string Name,
string PageSize,
string PageOrientation,
string FontFamily,
string SqlQuery,
string BackgroundColor,
List<RequestElementDto> RequestElements);
📜 License
Distributed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.3)
- TS.Result (>= 9.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release with core features:
- Dynamic SQL query execution
- Database schema retrieval
- Report model with customizable properties
- API integration for frontend communication