Entra C#.
Salen informes.
Un motor RDL de código abierto para .NET 8 y 10. PDF, Excel, HTML, CSV y más — desde SQL, JSON o C# puro. Apache 2.0, con componentes adicionales de triple licencia.
var parser = new RDLParser(rdlXml); using var report = await parser.Parse(); await report.RunGetData(null); await report.RunRender(ofs, OutputPresentationType.PDF);
Todo lo que necesitas para informes en .NET
Desde simples facturas en PDF hasta informes complejos de varias páginas con códigos de barras, gráficos y datos dinámicos — todo desde una sola biblioteca.
Exportación multiformato
Genera cualquier informe en PDF, Excel (xlsx), HTML, CSV, RTF y XML a partir de una sola consulta de datos. Una llamada, todos los formatos.
Fuentes de datos flexibles
Conéctate a SQLite, SQL Server, PostgreSQL, MySQL, Firebird, archivos JSON, XML, o inyecta datos directamente desde objetos C#.
Microsoft.Data.Sqlite · Json · SQL · PostgreSQLCódigos de barras y QR
10 tipos de códigos de barras CRI integrados vía ZXing.Net: QR Code, Code 128, Code 39, Data Matrix, Aztec, PDF417, ITF-14 y más.
Custom Report Items (CRI)Diseñador visual
Diseñador de informes de arrastrar y soltar en Windows. Diseña archivos RDL visualmente y luego renderízalos en el servidor en cualquier sistema operativo.
Diseñador de Windows · Renderizado multiplataformaMultiplataforma
El renderizado del lado del servidor funciona en Linux, macOS y Windows. Funciona muy bien en contenedores Docker y despliegues en la nube.
Linux · macOS · Windows · DockerFormato de informe RDL
Basado en el estándar abierto RDL (Report Definition Language). Los informes son archivos XML — cómodos para el control de versiones y portables.
Estándar abierto · XML · PortableLa alternativa moderna a las soluciones de informes tradicionales
Crystal Reports requiere .NET Framework y una licencia comercial. SSRS requiere SQL Server y un servidor Windows dedicado. Majorsilence Reporting es un paquete NuGet que funciona en cualquier lugar donde funcione .NET.
| Majorsilence Esta biblioteca |
Crystal Reports | SSRS | FastReport / DevExpress |
|
|---|---|---|---|---|
| Licencia | ✓ Núcleo Apache 2.0, componentes de triple licencia MIT/BSD — gratis | Comercial, por puesto | Requiere licencia de SQL Server | Comercial, por puesto |
| .NET 8 / 10 | ✓ Soporte completo | ✗ Solo .NET Framework | Solo renderizado (parcial) | ✓ Compatible |
| Linux / Docker | ✓ Multiplataforma | ✗ Solo Windows | ✗ Solo Windows Server | Varía según el producto |
| Despliegue | ✓ Paquete NuGet | Runtime redistribuible | Servidor de informes dedicado | Paquete NuGet |
| Formato de informe | ✓ RDL abierto (XML) | Binario .rpt (propietario) | ✓ RDL abierto (XML) | Propietario |
| Formatos de salida | PDF, XLSX, HTML, CSV, RTF, XML, TIFF, MHT | PDF, Excel, Word, HTML | PDF, Excel, Word, HTML, CSV | PDF, Excel, Word, HTML |
| Inyectar objetos C# | ✓ SetData() |
Limitado | Limitado | Varía |
| Portal de informes integrado | Constrúyelo tú mismo | Crystal Reports Server (coste adicional) | ✓ Incluido | Algunos productos incluyen uno |
| Código abierto | ✓ GitHub | ✗ | ✗ | ✗ |
¿Migrando desde Crystal Reports o SSRS?
Los informes de SSRS usan el mismo formato RDL abierto — muchos se renderizarán con Majorsilence Reporting sin modificaciones. Los archivos .rpt de Crystal Reports necesitan conversión, pero los informes tabulares sencillos se migran sin problemas.
Añádelo a tu proyecto
Disponible en NuGet. Añade el motor y, opcionalmente, el paquete CRI para soporte de códigos de barras.
Listo y funcionando en minutos
Llama a RdlEngineConfigInit() una vez al iniciar, carga un archivo RDL y renderiza en cualquier formato.
using Majorsilence.Reporting.Rdl; // Llamar una vez por instancia de la aplicación RdlEngineConfig.RdlEngineConfigInit(); var baseDir = AppContext.BaseDirectory; var dbPath = Path.Combine(baseDir, "mydata.db"); var outPath = Path.Combine(baseDir, "report.pdf"); var rdlXml = (await File.ReadAllTextAsync("Report.rdl")) .Replace("mydata.db", dbPath); var parser = new RDLParser(rdlXml) { Folder = baseDir }; using var report = await parser.Parse(); await report.RunGetData(null); var ofs = new OneFileStreamGen(outPath, true); await report.RunRender(ofs, OutputPresentationType.PDF);
// RunGetData una vez, y luego RunRender para cada formato. await report.RunGetData(null); foreach (var (filename, format) in new[] { ("report.pdf", OutputPresentationType.PDF), ("report.xlsx", OutputPresentationType.Excel2007), ("report.csv", OutputPresentationType.CSV), ("report.html", OutputPresentationType.HTML), }) { var ofs = new OneFileStreamGen(filename, true); await report.RunRender(ofs, format); }
/* En el DataSource del RDL */ <ConnectionProperties> <DataProvider>Json</DataProvider> <ConnectString>file=employees.json</ConnectString> </ConnectionProperties> var rdlXml = (await File.ReadAllTextAsync("Employees.rdl")) .Replace("employees.json", Path.Combine(baseDir, "employees.json")); var parser = new RDLParser(rdlXml) { Folder = baseDir }; using var report = await parser.Parse(); await report.RunGetData(null); await report.RunRender(new OneFileStreamGen("out.pdf", true), OutputPresentationType.PDF);
/* QrCode · BarCode128 · BarCode39 · DataMatrix · AztecCode · Pdf417 · ITF-14 */ <CustomReportItem Name="ProductQR"> <Type>QrCode</Type> <CustomProperties> <CustomProperty> <Name>Code</Name> <Value>=Fields!ProductName.Value</Value> </CustomProperty> </CustomProperties> </CustomReportItem> var parameters = new Dictionary<string, string> { ["BarcodeType"] = "DataMatrix" }; await report.RunGetData(parameters);
record SaleRecord(string Product, string Region, decimal Amount, int Quantity); var salesData = new List<SaleRecord> { new("Widget A", "North", 1250.00m, 50), new("Widget B", "South", 840.50m, 33), }; await report.DataSets["Data"].SetData(salesData); await report.RunGetData(null); await report.RunRender(ofs, OutputPresentationType.PDF);
Wiki y guías
El wiki de GitHub cubre cada tema en profundidad — desde la instalación y la migración hasta la configuración avanzada de proveedores de datos.
Página principal del wiki
Índice completo de todas las páginas de documentación.
→ github.com/majorsilence/Reporting/wikiMigración a v5
Cambios importantes, actualizaciones de espacios de nombres y guía de migración a la API asíncrona desde versiones anteriores.
→ Migration-to-v5Proveedor de datos JSON
Conecta informes a archivos JSON locales. Los objetos anidados son accesibles mediante notación con guion bajo.
→ Json-Data-ProviderCadenas de conexión dinámicas
Sustituye la cadena de conexión en tiempo de ejecución sin modificar el archivo RDL.
→ Set-Connection-String---RuntimeDiseñador web
Integra el diseñador de informes en una aplicación web para que los usuarios creen informes desde el navegador.
→ Web-DesignerContribuir
Cómo hacer fork, compilar, ejecutar las pruebas y enviar pull requests al proyecto.
→ Contribute