CoreReportes 2025.8.19
dotnet add package CoreReportes --version 2025.8.19
NuGet\Install-Package CoreReportes -Version 2025.8.19
<PackageReference Include="CoreReportes" Version="2025.8.19" />
<PackageVersion Include="CoreReportes" Version="2025.8.19" />
<PackageReference Include="CoreReportes" />
paket add CoreReportes --version 2025.8.19
#r "nuget: CoreReportes, 2025.8.19"
#:package CoreReportes@2025.8.19
#addin nuget:?package=CoreReportes&version=2025.8.19
#tool nuget:?package=CoreReportes&version=2025.8.19
CoreCrystalReports
Biblioteca que proporciona integración con Crystal Reports para la generación de reportes en aplicaciones .NET.
Características
- Integración completa con Crystal Reports
- Soporte para múltiples formatos de exportación (PDF, Excel, Word, etc.)
- Manejo de parámetros de reporte
- Configuración personalizable
- Integración con inyección de dependencias
- Caché de reportes para mejor rendimiento
- Manejo de excepciones robusto
Instalación
El componente se puede instalar como un paquete NuGet:
dotnet add package DeveloperKit.CoreCrystalReports
Requisitos
- Crystal Reports Runtime para .NET Framework
- .NET Framework 4.8 o superior
- Visual Studio 2019 o superior
Configuración
Configuración Inicial
public void ConfigureServices(IServiceCollection services)
{
services.AddCrystalReports(options =>
{
// Directorio donde se encuentran los archivos .rpt
options.ReportPath = Path.Combine(Directory.GetCurrentDirectory(), "Reports");
// Formato por defecto para la exportación
options.DefaultFormat = CrystalReportsFormat.PDF;
// Configuración de caché
options.EnableCache = true;
options.CacheDuration = TimeSpan.FromMinutes(30);
});
}
Uso
Generación de Reportes Básica
// Inyección del servicio
private readonly ICrystalReportsService _reportsService;
public MyController(ICrystalReportsService reportsService)
{
_reportsService = reportsService;
}
// Generar reporte
public async Task<IActionResult> GenerateReport()
{
var report = await _reportsService.GenerateReportAsync(
reportName: "SalesReport", // Nombre del archivo .rpt sin extensión
parameters: new Dictionary<string, object>
{
{ "StartDate", DateTime.Now.AddMonths(-1) },
{ "EndDate", DateTime.Now }
},
format: CrystalReportsFormat.PDF
);
return File(report, "application/pdf", "SalesReport.pdf");
}
Manejo de Errores
try
{
var report = await _reportsService.GenerateReportAsync(
reportName: "SalesReport",
parameters: parameters
);
}
catch (CrystalReportsException ex)
{
// Manejo específico de errores de Crystal Reports
_logger.LogError(ex, "Error generando reporte");
throw;
}
Exportación a Diferentes Formatos
// Exportar a PDF
var pdf = await _reportsService.GenerateReportAsync(
reportName: "SalesReport",
format: CrystalReportsFormat.PDF
);
// Exportar a Excel
var excel = await _reportsService.GenerateReportAsync(
reportName: "SalesReport",
format: CrystalReportsFormat.Excel
);
// Exportar a Word
var word = await _reportsService.GenerateReportAsync(
reportName: "SalesReport",
format: CrystalReportsFormat.Word
);
Configuración Avanzada
// Configuración de datos
public async Task<IActionResult> CustomReport()
{
var report = await _reportsService.GenerateReportAsync(
reportName: "CustomReport",
dataSource: new List<Customer>
{
new Customer { Id = 1, Name = "John Doe" },
new Customer { Id = 2, Name = "Jane Smith" }
},
format: CrystalReportsFormat.PDF
);
return File(report, "application/pdf", "CustomReport.pdf");
}
Mejores Prácticas
- Siempre validar los parámetros antes de generar el reporte
- Implementar caché para reportes frecuentemente usados
- Manejar adecuadamente los errores de Crystal Reports
- Usar nombres descriptivos para los archivos .rpt
- Documentar los parámetros requeridos en cada reporte
Soporte
Para reportar errores o solicitar características, por favor abre un issue en el repositorio de GitHub.
Licencia
Este proyecto está bajo licencia MIT. Consulta el archivo LICENSE para más detalles. parameters: new Dictionary<string, object> { { "FromDate", DateTime.Now.AddMonths(-1) }, { "ToDate", DateTime.Now } });
return File(report.Bytes, report.ContentType);
}
## Configuración Avanzada
### Formatos de Exportación
```C#
public enum CrystalReportsFormat
{
PDF,
Excel,
Word,
Html,
Rtf
}
Manejo de Parámetros
public class ReportParameters
{
public DateTime FromDate { get; set; }
public DateTime ToDate { get; set; }
public string ReportTitle { get; set; }
}
Soporte
Para reportar errores o solicitar características, por favor abre un issue en el repositorio principal de DeveloperKit V2.
Licencia
Este componente está bajo licencia MIT. Consulta el archivo LICENSE para más detalles. }
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
2025.8.19 | 162 | 8/19/2025 |
2025.7.13 | 163 | 7/14/2025 |
2025.5.23 | 118 | 5/23/2025 |
2025.5.1 | 190 | 5/1/2025 |
2025.4.30 | 179 | 4/30/2025 |
2025.3.22 | 199 | 3/22/2025 |
2025.3.8 | 172 | 3/9/2025 |
2025.2.1 | 183 | 2/1/2025 |
2024.12.29 | 144 | 12/28/2024 |
2024.12.28 | 139 | 12/28/2024 |
2024.10.6 | 170 | 10/4/2024 |
2024.7.24 | 192 | 7/24/2024 |
2024.4.22 | 200 | 4/23/2024 |
2023.8.14 | 296 | 8/14/2023 |
2023.8.9 | 220 | 8/9/2023 |
2023.7.30 | 231 | 7/31/2023 |
2023.7.11 | 236 | 7/12/2023 |
2023.7.6 | 242 | 7/6/2023 |
2023.6.30 | 248 | 7/1/2023 |
2023.6.15 | 237 | 6/19/2023 |
2023.5.20 | 235 | 5/16/2023 |
2023.5.14 | 235 | 5/8/2023 |
2023.3.2 | 322 | 3/3/2023 |
2023.2.26 | 325 | 2/27/2023 |
2023.2.18 | 336 | 2/19/2023 |
2023.2.11 | 332 | 2/11/2023 |
2023.1.30 | 346 | 1/31/2023 |
2022.10.17 | 530 | 10/18/2022 |
2022.10.5 | 477 | 10/6/2022 |