nexabase-report 0.2.9 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{html2canvas-C7YA4nkW.js → html2canvas-9Wez5E_d.js} +1 -1
- package/dist/{html2canvas-Ch6xQdU-.js → html2canvas-BljFROJ3.js} +2 -2
- package/dist/{html2pdf-BmsoJhgy.js → html2pdf-BnHxGKGb.js} +3 -3
- package/dist/{index-TKDtDVn8.js → index-TaXb6NxF.js} +23212 -23262
- package/dist/{index.es-DVVUHaBy.js → index.es-Cfi8g62z.js} +2 -2
- package/dist/{jspdf.es.min-C0JdIV8T.js → jspdf.es.min-BdLNvemB.js} +2 -2
- package/dist/nexabase-report.es.js +1 -1
- package/dist/nexabase-report.umd.js +159 -159
- package/examples/BlazorServer/Pages/FacturaReport.razor +52 -52
- package/examples/blazor-report/Components/App.razor +19 -19
- package/examples/blazor-report/Components/Layout/MainLayout.razor +4 -20
- package/examples/blazor-report/Components/Layout/NavMenu.razor +1 -1
- package/examples/blazor-report/Components/Layout/ReconnectModal.razor +1 -1
- package/examples/blazor-report/Components/Pages/Counter.razor +1 -1
- package/examples/blazor-report/Components/Pages/Error.razor +1 -1
- package/examples/blazor-report/Components/Pages/Factura.razor +36 -32
- package/examples/blazor-report/Components/Pages/Home.razor +16 -16
- package/examples/blazor-report/Components/Pages/NotFound.razor +2 -2
- package/examples/blazor-report/Components/Pages/Weather.razor +1 -1
- package/examples/blazor-report/Components/Routes.razor +1 -1
- package/examples/blazor-report/Components/_Imports.razor +1 -1
- package/examples/blazor-report/bin/Debug/net10.0/blazor-report.dll +0 -0
- package/examples/blazor-report/bin/Debug/net10.0/blazor-report.exe +0 -0
- package/examples/blazor-report/bin/Debug/net10.0/blazor-report.pdb +0 -0
- package/examples/blazor-report/obj/Debug/net10.0/apphost.exe +0 -0
- package/examples/blazor-report/obj/Debug/net10.0/blazor-report.AssemblyInfo.cs +5 -6
- package/examples/blazor-report/obj/Debug/net10.0/blazor-report.AssemblyInfoInputs.cache +1 -1
- package/examples/blazor-report/obj/Debug/net10.0/blazor-report.dll +0 -0
- package/examples/blazor-report/obj/Debug/net10.0/blazor-report.pdb +0 -0
- package/examples/blazor-report/obj/Debug/net10.0/blazor-report.sourcelink.json +1 -1
- package/examples/blazor-report/obj/Debug/net10.0/ref/blazor-report.dll +0 -0
- package/examples/blazor-report/obj/Debug/net10.0/refint/blazor-report.dll +0 -0
- package/examples/blazor-report/obj/Debug/net10.0/rjsmcshtml.dswa.cache.json +1 -1
- package/examples/blazor-report/obj/Debug/net10.0/rjsmrazor.dswa.cache.json +1 -1
- package/examples/blazor-report/obj/Debug/net10.0/rpswa.dswa.cache.json +1 -1
- package/examples/integration/BlazorRazor.razor +84 -84
- package/examples/integration/BlazorServer.razor +91 -91
- package/examples/integration/index.html +100 -100
- package/examples/integration/integration-jquery.html +142 -142
- package/examples/integration-angular.html +99 -99
- package/examples/integration-api.html +80 -80
- package/examples/integration-react.html +80 -80
- package/examples/integration-vanilla.html +66 -66
- package/examples/integration-vue.html +85 -85
- package/examples/viewer.html +58 -58
- package/package.json +1 -1
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="es">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Reporte - Ejemplo jQuery + nexabase-report</title>
|
|
7
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nexabase-report@0.2.
|
|
8
|
-
<style>
|
|
9
|
-
body { font-family: system-ui, sans-serif; margin: 20px; background: #f9fafb; }
|
|
10
|
-
.report-container { height: 800px; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; background: white; }
|
|
11
|
-
.toolbar { margin-bottom: 12px; display: flex; gap: 8px; }
|
|
12
|
-
.btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
|
|
13
|
-
.btn-primary { background: #1e40af; color: white; }
|
|
14
|
-
.btn-success { background: #16a34a; color: white; }
|
|
15
|
-
.btn-outline { background: white; border: 1px solid #d1d5db; }
|
|
16
|
-
.info { margin-top: 12px; padding: 12px; background: #eff6ff; border-radius: 6px; font-size: 13px; }
|
|
17
|
-
</style>
|
|
18
|
-
</head>
|
|
19
|
-
<body>
|
|
20
|
-
<h2>Reporte de Factura</h2>
|
|
21
|
-
|
|
22
|
-
<div class="toolbar">
|
|
23
|
-
<button class="btn btn-primary" id="btnPdf">Exportar PDF</button>
|
|
24
|
-
<button class="btn btn-success" id="btnExcel">Exportar Excel</button>
|
|
25
|
-
<button class="btn btn-outline" id="btnCsv">Exportar CSV</button>
|
|
26
|
-
<button class="btn btn-outline" id="btnReload">Recargar</button>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<nexa-viewer id="reportViewer"></nexa-viewer>
|
|
30
|
-
|
|
31
|
-
<div class="info">
|
|
32
|
-
<strong>Datos simulados generados por jQuery/JavaScript:</strong><br>
|
|
33
|
-
Los datos de factura e items son construidos dinámicamente en el cliente.
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<script src="https://cdn.jsdelivr.net/npm/nexabase-report@0.2.
|
|
37
|
-
<script>
|
|
38
|
-
$(function() {
|
|
39
|
-
// Registrar el custom element una vez
|
|
40
|
-
NexaReport.registerNexaReport();
|
|
41
|
-
|
|
42
|
-
// Datos simulados (como vendrían de un API en .NET)
|
|
43
|
-
var facturaData = {
|
|
44
|
-
numeroFactura: "FV-2026-00456",
|
|
45
|
-
fecha: "2026-05-09",
|
|
46
|
-
nombreCliente: "CLIENTE EJEMPLO S.A.S.",
|
|
47
|
-
nitCliente: "900.987.654-3",
|
|
48
|
-
direccionCliente: "Carrera 15 # 88-40, Bogotá D.C.",
|
|
49
|
-
formaPago: "Crédito 30 días",
|
|
50
|
-
vendedor: "Carlos Mendoza"
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
var itemsData = [
|
|
54
|
-
{ codigo: "P-001", descripcion: "Portátil HP ProBook 450 G10", cantidad: 2, precioUnitario: 3250000, descuentoPorcentaje: 5, subtotal: 6175000 },
|
|
55
|
-
{ codigo: "P-002", descripcion: "Monitor Dell 27'' UltraSharp", cantidad: 2, precioUnitario: 1450000, descuentoPorcentaje: 0, subtotal: 2900000 },
|
|
56
|
-
{ codigo: "P-003", descripcion: "Teclado mecánico Logitech MX", cantidad: 5, precioUnitario: 285000, descuentoPorcentaje: 10, subtotal: 1282500 },
|
|
57
|
-
{ codigo: "P-004", descripcion: "Mouse wireless Logitech MX Master 3", cantidad: 5, precioUnitario: 380000, descuentoPorcentaje: 10, subtotal: 1710000 },
|
|
58
|
-
{ codigo: "P-005", descripcion: "Webcam Logitech Brio 4K", cantidad: 3, precioUnitario: 650000, descuentoPorcentaje: 0, subtotal: 1950000 },
|
|
59
|
-
{ codigo: "P-006", descripcion: "Docking station Dell WD19TBS", cantidad: 2, precioUnitario: 890000, descuentoPorcentaje: 5, subtotal: 1691000 }
|
|
60
|
-
];
|
|
61
|
-
|
|
62
|
-
var definition = {
|
|
63
|
-
metadata: {
|
|
64
|
-
name: "Factura de Venta",
|
|
65
|
-
author: "Sistema .NET",
|
|
66
|
-
createdAt: new Date().toISOString()
|
|
67
|
-
},
|
|
68
|
-
layout: {
|
|
69
|
-
page: { format: "A4", orientation: "portrait", margins: { top: 1.5, right: 1, bottom: 1, left: 1 } },
|
|
70
|
-
bands: [
|
|
71
|
-
{
|
|
72
|
-
id: "rh_factura", type: "ReportHeader", height: 250,
|
|
73
|
-
elements: [
|
|
74
|
-
{ id: "t_titulo", type: "Text", x: 20, y: 10, width: 300, height: 24, content: "MI EMPRESA S.A.", style: { fontSize: "20px", fontWeight: "bold", color: "#1e3a8a" } },
|
|
75
|
-
{ id: "t_num", type: "Text", x: 450, y: 10, width: 210, height: 24, content: "FACTURA N° {{numeroFactura}}", style: { fontSize: "18px", fontWeight: "bold", color: "#1e40af", textAlign: "right" } },
|
|
76
|
-
{ id: "t_cliente", type: "Text", x: 20, y: 112, width: 280, height: 16, content: "{{nombreCliente}}", style: { fontSize: "12px", color: "#1e293b" } },
|
|
77
|
-
{ id: "t_nit", type: "Text", x: 20, y: 130, width: 200, height: 14, content: "NIT: {{nitCliente}}", style: { fontSize: "11px", color: "#64748b" } },
|
|
78
|
-
{ id: "t_direccion", type: "Text", x: 20, y: 146, width: 350, height: 14, content: "{{direccionCliente}}", style: { fontSize: "11px", color: "#64748b" } },
|
|
79
|
-
{ id: "t_fecha", type: "Text", x: 450, y: 58, width: 210, height: 14, content: "Fecha: {{fecha}}", style: { fontSize: "11px", color: "#64748b", textAlign: "right" } },
|
|
80
|
-
{ id: "t_vendedor", type: "Text", x: 480, y: 130, width: 180, height: 14, content: "Vendedor: {{vendedor}}", style: { fontSize: "11px", color: "#475569", textAlign: "right" } }
|
|
81
|
-
]
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: "db_items", type: "DataBand", height: 280, dataSource: "items",
|
|
85
|
-
elements: [
|
|
86
|
-
{
|
|
87
|
-
id: "table_items", type: "Table", x: 0, y: 30, width: 680, height: 240,
|
|
88
|
-
tableColumns: [
|
|
89
|
-
{ id: "c1", title: "Código", width: 80, binding: "codigo" },
|
|
90
|
-
{ id: "c2", title: "Producto", width: 260, binding: "descripcion" },
|
|
91
|
-
{ id: "c3", title: "Cant.", width: 70, binding: "cantidad" },
|
|
92
|
-
{ id: "c4", title: "Precio Unit.", width: 110, binding: "precioUnitario" },
|
|
93
|
-
{ id: "c5", title: "Desc.", width: 60, binding: "descuentoPorcentaje" },
|
|
94
|
-
{ id: "c6", title: "Subtotal", width: 100, binding: "subtotal" }
|
|
95
|
-
],
|
|
96
|
-
tableShowFooter: true,
|
|
97
|
-
style: { fontSize: "11px" }
|
|
98
|
-
}
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
id: "rf_totales", type: "ReportFooter", height: 120,
|
|
103
|
-
elements: [
|
|
104
|
-
{ id: "t_subtotal_label", type: "Text", x: 400, y: 8, width: 120, height: 18, content: "Subtotal:", style: { fontSize: "12px", fontWeight: "bold", textAlign: "right" } },
|
|
105
|
-
{ id: "t_subtotal_val", type: "Text", x: 530, y: 8, width: 150, height: 18, content: "${[sum(subtotal)]}", style: { fontSize: "12px", textAlign: "right" } },
|
|
106
|
-
{ id: "t_total_label", type: "Text", x: 400, y: 76, width: 120, height: 28, content: "TOTAL:", style: { fontSize: "16px", fontWeight: "bold", color: "#1e3a8a", textAlign: "right" } },
|
|
107
|
-
{ id: "t_total_val", type: "Text", x: 530, y: 76, width: 150, height: 28, content: "${[sum(subtotal) * 1.19]}", style: { fontSize: "18px", fontWeight: "bold", color: "#1e3a8a", textAlign: "right" } }
|
|
108
|
-
]
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
id: "pf_pagina", type: "PageFooter", height: 30,
|
|
112
|
-
elements: [
|
|
113
|
-
{ id: "t_pagina", type: "Text", x: 0, y: 8, width: 680, height: 16, content: "Página {{Page}} de {{TotalPages}}", style: { fontSize: "9px", color: "#94a3b8", textAlign: "center" } }
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
],
|
|
117
|
-
watermark: { text: "", opacity: 0 }
|
|
118
|
-
},
|
|
119
|
-
dataSources: [
|
|
120
|
-
{ id: "ds_factura", alias: "factura", enabled: true, isManual: true, manualData: [facturaData] },
|
|
121
|
-
{ id: "ds_items", alias: "items", enabled: true, isManual: true, manualData: itemsData }
|
|
122
|
-
],
|
|
123
|
-
documentType: "Report"
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
// Asignar al viewer
|
|
127
|
-
var viewer = document.getElementById('reportViewer');
|
|
128
|
-
viewer.definition = definition;
|
|
129
|
-
viewer.data = { factura: [facturaData], items: itemsData };
|
|
130
|
-
|
|
131
|
-
// Botones
|
|
132
|
-
$('#btnPdf').click(function() { viewer.exportPdf(); });
|
|
133
|
-
$('#btnExcel').click(function() { viewer.exportExcel(); });
|
|
134
|
-
$('#btnCsv').click(function() { viewer.exportCsv(); });
|
|
135
|
-
$('#btnReload').click(function() {
|
|
136
|
-
viewer.definition = null;
|
|
137
|
-
setTimeout(function() { viewer.definition = definition; }, 50);
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
</script>
|
|
141
|
-
</body>
|
|
142
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="es">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Reporte - Ejemplo jQuery + nexabase-report</title>
|
|
7
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nexabase-report@0.2.10/dist/style.css">
|
|
8
|
+
<style>
|
|
9
|
+
body { font-family: system-ui, sans-serif; margin: 20px; background: #f9fafb; }
|
|
10
|
+
.report-container { height: 800px; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; background: white; }
|
|
11
|
+
.toolbar { margin-bottom: 12px; display: flex; gap: 8px; }
|
|
12
|
+
.btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
|
|
13
|
+
.btn-primary { background: #1e40af; color: white; }
|
|
14
|
+
.btn-success { background: #16a34a; color: white; }
|
|
15
|
+
.btn-outline { background: white; border: 1px solid #d1d5db; }
|
|
16
|
+
.info { margin-top: 12px; padding: 12px; background: #eff6ff; border-radius: 6px; font-size: 13px; }
|
|
17
|
+
</style>
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
<h2>Reporte de Factura</h2>
|
|
21
|
+
|
|
22
|
+
<div class="toolbar">
|
|
23
|
+
<button class="btn btn-primary" id="btnPdf">Exportar PDF</button>
|
|
24
|
+
<button class="btn btn-success" id="btnExcel">Exportar Excel</button>
|
|
25
|
+
<button class="btn btn-outline" id="btnCsv">Exportar CSV</button>
|
|
26
|
+
<button class="btn btn-outline" id="btnReload">Recargar</button>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<nexa-viewer id="reportViewer"></nexa-viewer>
|
|
30
|
+
|
|
31
|
+
<div class="info">
|
|
32
|
+
<strong>Datos simulados generados por jQuery/JavaScript:</strong><br>
|
|
33
|
+
Los datos de factura e items son construidos dinámicamente en el cliente.
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<script src="https://cdn.jsdelivr.net/npm/nexabase-report@0.2.10/dist/nexabase-report.umd.js"></script>
|
|
37
|
+
<script>
|
|
38
|
+
$(function() {
|
|
39
|
+
// Registrar el custom element una vez
|
|
40
|
+
NexaReport.registerNexaReport();
|
|
41
|
+
|
|
42
|
+
// Datos simulados (como vendrían de un API en .NET)
|
|
43
|
+
var facturaData = {
|
|
44
|
+
numeroFactura: "FV-2026-00456",
|
|
45
|
+
fecha: "2026-05-09",
|
|
46
|
+
nombreCliente: "CLIENTE EJEMPLO S.A.S.",
|
|
47
|
+
nitCliente: "900.987.654-3",
|
|
48
|
+
direccionCliente: "Carrera 15 # 88-40, Bogotá D.C.",
|
|
49
|
+
formaPago: "Crédito 30 días",
|
|
50
|
+
vendedor: "Carlos Mendoza"
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
var itemsData = [
|
|
54
|
+
{ codigo: "P-001", descripcion: "Portátil HP ProBook 450 G10", cantidad: 2, precioUnitario: 3250000, descuentoPorcentaje: 5, subtotal: 6175000 },
|
|
55
|
+
{ codigo: "P-002", descripcion: "Monitor Dell 27'' UltraSharp", cantidad: 2, precioUnitario: 1450000, descuentoPorcentaje: 0, subtotal: 2900000 },
|
|
56
|
+
{ codigo: "P-003", descripcion: "Teclado mecánico Logitech MX", cantidad: 5, precioUnitario: 285000, descuentoPorcentaje: 10, subtotal: 1282500 },
|
|
57
|
+
{ codigo: "P-004", descripcion: "Mouse wireless Logitech MX Master 3", cantidad: 5, precioUnitario: 380000, descuentoPorcentaje: 10, subtotal: 1710000 },
|
|
58
|
+
{ codigo: "P-005", descripcion: "Webcam Logitech Brio 4K", cantidad: 3, precioUnitario: 650000, descuentoPorcentaje: 0, subtotal: 1950000 },
|
|
59
|
+
{ codigo: "P-006", descripcion: "Docking station Dell WD19TBS", cantidad: 2, precioUnitario: 890000, descuentoPorcentaje: 5, subtotal: 1691000 }
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
var definition = {
|
|
63
|
+
metadata: {
|
|
64
|
+
name: "Factura de Venta",
|
|
65
|
+
author: "Sistema .NET",
|
|
66
|
+
createdAt: new Date().toISOString()
|
|
67
|
+
},
|
|
68
|
+
layout: {
|
|
69
|
+
page: { format: "A4", orientation: "portrait", margins: { top: 1.5, right: 1, bottom: 1, left: 1 } },
|
|
70
|
+
bands: [
|
|
71
|
+
{
|
|
72
|
+
id: "rh_factura", type: "ReportHeader", height: 250,
|
|
73
|
+
elements: [
|
|
74
|
+
{ id: "t_titulo", type: "Text", x: 20, y: 10, width: 300, height: 24, content: "MI EMPRESA S.A.", style: { fontSize: "20px", fontWeight: "bold", color: "#1e3a8a" } },
|
|
75
|
+
{ id: "t_num", type: "Text", x: 450, y: 10, width: 210, height: 24, content: "FACTURA N° {{numeroFactura}}", style: { fontSize: "18px", fontWeight: "bold", color: "#1e40af", textAlign: "right" } },
|
|
76
|
+
{ id: "t_cliente", type: "Text", x: 20, y: 112, width: 280, height: 16, content: "{{nombreCliente}}", style: { fontSize: "12px", color: "#1e293b" } },
|
|
77
|
+
{ id: "t_nit", type: "Text", x: 20, y: 130, width: 200, height: 14, content: "NIT: {{nitCliente}}", style: { fontSize: "11px", color: "#64748b" } },
|
|
78
|
+
{ id: "t_direccion", type: "Text", x: 20, y: 146, width: 350, height: 14, content: "{{direccionCliente}}", style: { fontSize: "11px", color: "#64748b" } },
|
|
79
|
+
{ id: "t_fecha", type: "Text", x: 450, y: 58, width: 210, height: 14, content: "Fecha: {{fecha}}", style: { fontSize: "11px", color: "#64748b", textAlign: "right" } },
|
|
80
|
+
{ id: "t_vendedor", type: "Text", x: 480, y: 130, width: 180, height: 14, content: "Vendedor: {{vendedor}}", style: { fontSize: "11px", color: "#475569", textAlign: "right" } }
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "db_items", type: "DataBand", height: 280, dataSource: "items",
|
|
85
|
+
elements: [
|
|
86
|
+
{
|
|
87
|
+
id: "table_items", type: "Table", x: 0, y: 30, width: 680, height: 240,
|
|
88
|
+
tableColumns: [
|
|
89
|
+
{ id: "c1", title: "Código", width: 80, binding: "codigo" },
|
|
90
|
+
{ id: "c2", title: "Producto", width: 260, binding: "descripcion" },
|
|
91
|
+
{ id: "c3", title: "Cant.", width: 70, binding: "cantidad" },
|
|
92
|
+
{ id: "c4", title: "Precio Unit.", width: 110, binding: "precioUnitario" },
|
|
93
|
+
{ id: "c5", title: "Desc.", width: 60, binding: "descuentoPorcentaje" },
|
|
94
|
+
{ id: "c6", title: "Subtotal", width: 100, binding: "subtotal" }
|
|
95
|
+
],
|
|
96
|
+
tableShowFooter: true,
|
|
97
|
+
style: { fontSize: "11px" }
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "rf_totales", type: "ReportFooter", height: 120,
|
|
103
|
+
elements: [
|
|
104
|
+
{ id: "t_subtotal_label", type: "Text", x: 400, y: 8, width: 120, height: 18, content: "Subtotal:", style: { fontSize: "12px", fontWeight: "bold", textAlign: "right" } },
|
|
105
|
+
{ id: "t_subtotal_val", type: "Text", x: 530, y: 8, width: 150, height: 18, content: "${[sum(subtotal)]}", style: { fontSize: "12px", textAlign: "right" } },
|
|
106
|
+
{ id: "t_total_label", type: "Text", x: 400, y: 76, width: 120, height: 28, content: "TOTAL:", style: { fontSize: "16px", fontWeight: "bold", color: "#1e3a8a", textAlign: "right" } },
|
|
107
|
+
{ id: "t_total_val", type: "Text", x: 530, y: 76, width: 150, height: 28, content: "${[sum(subtotal) * 1.19]}", style: { fontSize: "18px", fontWeight: "bold", color: "#1e3a8a", textAlign: "right" } }
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "pf_pagina", type: "PageFooter", height: 30,
|
|
112
|
+
elements: [
|
|
113
|
+
{ id: "t_pagina", type: "Text", x: 0, y: 8, width: 680, height: 16, content: "Página {{Page}} de {{TotalPages}}", style: { fontSize: "9px", color: "#94a3b8", textAlign: "center" } }
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
watermark: { text: "", opacity: 0 }
|
|
118
|
+
},
|
|
119
|
+
dataSources: [
|
|
120
|
+
{ id: "ds_factura", alias: "factura", enabled: true, isManual: true, manualData: [facturaData] },
|
|
121
|
+
{ id: "ds_items", alias: "items", enabled: true, isManual: true, manualData: itemsData }
|
|
122
|
+
],
|
|
123
|
+
documentType: "Report"
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// Asignar al viewer
|
|
127
|
+
var viewer = document.getElementById('reportViewer');
|
|
128
|
+
viewer.definition = definition;
|
|
129
|
+
viewer.data = { factura: [facturaData], items: itemsData };
|
|
130
|
+
|
|
131
|
+
// Botones
|
|
132
|
+
$('#btnPdf').click(function() { viewer.exportPdf(); });
|
|
133
|
+
$('#btnExcel').click(function() { viewer.exportExcel(); });
|
|
134
|
+
$('#btnCsv').click(function() { viewer.exportCsv(); });
|
|
135
|
+
$('#btnReload').click(function() {
|
|
136
|
+
viewer.definition = null;
|
|
137
|
+
setTimeout(function() { viewer.definition = definition; }, 50);
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
</script>
|
|
141
|
+
</body>
|
|
142
|
+
</html>
|
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="es">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>NexaReport — Angular</title>
|
|
7
|
-
<link rel="stylesheet" href="../dist/style.css">
|
|
8
|
-
<style>
|
|
9
|
-
body { margin: 0; font-family: system-ui, sans-serif; }
|
|
10
|
-
#app { height: 100vh; display: flex; flex-direction: column; }
|
|
11
|
-
header { padding: 12px 20px; background: #1e293b; color: #fff; display: flex; align-items: center; gap: 12px; }
|
|
12
|
-
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
|
|
13
|
-
header small { opacity: 0.7; }
|
|
14
|
-
nexa-viewer { flex: 1; display: block; }
|
|
15
|
-
</style>
|
|
16
|
-
</head>
|
|
17
|
-
<body>
|
|
18
|
-
<div id="app">
|
|
19
|
-
<header>
|
|
20
|
-
<h1>NexaReport</h1>
|
|
21
|
-
<small>Angular · Demo</small>
|
|
22
|
-
</header>
|
|
23
|
-
<nexa-viewer id="viewer" minimal></nexa-viewer>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<script src="https://unpkg.com/@angular/core@18/bundles/core.umd.js"></script>
|
|
27
|
-
<script src="https://unpkg.com/@angular/common@18/bundles/common.umd.js"></script>
|
|
28
|
-
<script src="https://unpkg.com/@angular/compiler@18/bundles/compiler.umd.js"></script>
|
|
29
|
-
<script src="https://unpkg.com/@angular/platform-browser@18/bundles/platform-browser.umd.js"></script>
|
|
30
|
-
<script src="https://unpkg.com/@angular/platform-browser-dynamic@18/bundles/platform-browser-dynamic.umd.js"></script>
|
|
31
|
-
<script src="https://unpkg.com/zone.js@0.14/dist/zone.js"></script>
|
|
32
|
-
<script src="https://unpkg.com/rxjs@7/dist/bundles/rxjs.umd.js"></script>
|
|
33
|
-
<script src="../dist/nexabase-report.umd.js"></script>
|
|
34
|
-
<script>
|
|
35
|
-
NexaReport.registerNexaReport();
|
|
36
|
-
|
|
37
|
-
const reportDef = {
|
|
38
|
-
metadata: { version: '1', name: 'Clientes', createdAt: new Date().toISOString() },
|
|
39
|
-
layout: {
|
|
40
|
-
page: { format: 'A4', orientation: 'portrait', margins: { top: 1, right: 1, bottom: 1, left: 1 } },
|
|
41
|
-
bands: [
|
|
42
|
-
{ id: 'b_hdr', type: 'ReportHeader', height: 60, elements: [
|
|
43
|
-
{ id: 'e_titulo', type: 'Text', x: 20, y: 10, width: 500, height: 30,
|
|
44
|
-
content: 'Directorio de Clientes', style: { fontSize: '22px', fontWeight: 'bold' } }
|
|
45
|
-
]},
|
|
46
|
-
{ id: 'b_data', type: 'DataBand', height: 30, dataSource: 'main', elements: [
|
|
47
|
-
{ id: 'e_nombre', type: 'Text', x: 20, y: 5, width: 200, height: 20,
|
|
48
|
-
binding: 'nombre', style: { fontSize: '12px' } },
|
|
49
|
-
{ id: 'e_email', type: 'Text', x: 240, y: 5, width: 250, height: 20,
|
|
50
|
-
binding: 'email', style: { fontSize: '12px' } },
|
|
51
|
-
{ id: 'e_ciudad', type: 'Text', x: 510, y: 5, width: 150, height: 20,
|
|
52
|
-
binding: 'ciudad', style: { fontSize: '12px' } }
|
|
53
|
-
]},
|
|
54
|
-
{ id: 'b_ftr', type: 'PageFooter', height: 30, elements: [
|
|
55
|
-
{ id: 'e_page', type: 'Text', x: 20, y: 5, width: 200, height: 20,
|
|
56
|
-
content: 'Página {[Page]} de {[TotalPages]}', style: { fontSize: '10px', color: '#666' } }
|
|
57
|
-
]}
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
dataSources: [{ id: 'ds1', collection: '', alias: 'main', enabled: true }]
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const data = [
|
|
64
|
-
{ nombre: 'Juan Pérez', email: 'juan@mail.com', ciudad: 'Madrid' },
|
|
65
|
-
{ nombre: 'María López', email: 'maria@mail.com', ciudad: 'Barcelona' },
|
|
66
|
-
{ nombre: 'Carlos Ruiz', email: 'carlos@mail.com', ciudad: 'Valencia' },
|
|
67
|
-
];
|
|
68
|
-
|
|
69
|
-
(function() {
|
|
70
|
-
const { Component, NgModule } = ng.core;
|
|
71
|
-
const { BrowserModule } = ng.platformBrowser;
|
|
72
|
-
const { platformBrowserDynamic } = ng.platformBrowserDynamic;
|
|
73
|
-
const { CommonModule } = ng.common;
|
|
74
|
-
|
|
75
|
-
@Component({
|
|
76
|
-
selector: 'app-root',
|
|
77
|
-
template: '<nexa-viewer id="viewer" minimal></nexa-viewer>'
|
|
78
|
-
})
|
|
79
|
-
class AppComponent {
|
|
80
|
-
ngAfterViewInit() {
|
|
81
|
-
const viewer = document.getElementById('viewer');
|
|
82
|
-
viewer.definition = reportDef;
|
|
83
|
-
viewer.data = data;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
@NgModule({
|
|
88
|
-
imports: [BrowserModule],
|
|
89
|
-
declarations: [AppComponent],
|
|
90
|
-
schemas: [ng.core.CUSTOM_ELEMENTS_SCHEMA],
|
|
91
|
-
bootstrap: [AppComponent]
|
|
92
|
-
})
|
|
93
|
-
class AppModule {}
|
|
94
|
-
|
|
95
|
-
platformBrowserDynamic().bootstrapModule(AppModule);
|
|
96
|
-
})();
|
|
97
|
-
</script>
|
|
98
|
-
</body>
|
|
99
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="es">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>NexaReport — Angular</title>
|
|
7
|
+
<link rel="stylesheet" href="../dist/style.css">
|
|
8
|
+
<style>
|
|
9
|
+
body { margin: 0; font-family: system-ui, sans-serif; }
|
|
10
|
+
#app { height: 100vh; display: flex; flex-direction: column; }
|
|
11
|
+
header { padding: 12px 20px; background: #1e293b; color: #fff; display: flex; align-items: center; gap: 12px; }
|
|
12
|
+
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
|
|
13
|
+
header small { opacity: 0.7; }
|
|
14
|
+
nexa-viewer { flex: 1; display: block; }
|
|
15
|
+
</style>
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
<div id="app">
|
|
19
|
+
<header>
|
|
20
|
+
<h1>NexaReport</h1>
|
|
21
|
+
<small>Angular · Demo</small>
|
|
22
|
+
</header>
|
|
23
|
+
<nexa-viewer id="viewer" minimal></nexa-viewer>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<script src="https://unpkg.com/@angular/core@18/bundles/core.umd.js"></script>
|
|
27
|
+
<script src="https://unpkg.com/@angular/common@18/bundles/common.umd.js"></script>
|
|
28
|
+
<script src="https://unpkg.com/@angular/compiler@18/bundles/compiler.umd.js"></script>
|
|
29
|
+
<script src="https://unpkg.com/@angular/platform-browser@18/bundles/platform-browser.umd.js"></script>
|
|
30
|
+
<script src="https://unpkg.com/@angular/platform-browser-dynamic@18/bundles/platform-browser-dynamic.umd.js"></script>
|
|
31
|
+
<script src="https://unpkg.com/zone.js@0.14/dist/zone.js"></script>
|
|
32
|
+
<script src="https://unpkg.com/rxjs@7/dist/bundles/rxjs.umd.js"></script>
|
|
33
|
+
<script src="../dist/nexabase-report.umd.js"></script>
|
|
34
|
+
<script>
|
|
35
|
+
NexaReport.registerNexaReport();
|
|
36
|
+
|
|
37
|
+
const reportDef = {
|
|
38
|
+
metadata: { version: '1', name: 'Clientes', createdAt: new Date().toISOString() },
|
|
39
|
+
layout: {
|
|
40
|
+
page: { format: 'A4', orientation: 'portrait', margins: { top: 1, right: 1, bottom: 1, left: 1 } },
|
|
41
|
+
bands: [
|
|
42
|
+
{ id: 'b_hdr', type: 'ReportHeader', height: 60, elements: [
|
|
43
|
+
{ id: 'e_titulo', type: 'Text', x: 20, y: 10, width: 500, height: 30,
|
|
44
|
+
content: 'Directorio de Clientes', style: { fontSize: '22px', fontWeight: 'bold' } }
|
|
45
|
+
]},
|
|
46
|
+
{ id: 'b_data', type: 'DataBand', height: 30, dataSource: 'main', elements: [
|
|
47
|
+
{ id: 'e_nombre', type: 'Text', x: 20, y: 5, width: 200, height: 20,
|
|
48
|
+
binding: 'nombre', style: { fontSize: '12px' } },
|
|
49
|
+
{ id: 'e_email', type: 'Text', x: 240, y: 5, width: 250, height: 20,
|
|
50
|
+
binding: 'email', style: { fontSize: '12px' } },
|
|
51
|
+
{ id: 'e_ciudad', type: 'Text', x: 510, y: 5, width: 150, height: 20,
|
|
52
|
+
binding: 'ciudad', style: { fontSize: '12px' } }
|
|
53
|
+
]},
|
|
54
|
+
{ id: 'b_ftr', type: 'PageFooter', height: 30, elements: [
|
|
55
|
+
{ id: 'e_page', type: 'Text', x: 20, y: 5, width: 200, height: 20,
|
|
56
|
+
content: 'Página {[Page]} de {[TotalPages]}', style: { fontSize: '10px', color: '#666' } }
|
|
57
|
+
]}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
dataSources: [{ id: 'ds1', collection: '', alias: 'main', enabled: true }]
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const data = [
|
|
64
|
+
{ nombre: 'Juan Pérez', email: 'juan@mail.com', ciudad: 'Madrid' },
|
|
65
|
+
{ nombre: 'María López', email: 'maria@mail.com', ciudad: 'Barcelona' },
|
|
66
|
+
{ nombre: 'Carlos Ruiz', email: 'carlos@mail.com', ciudad: 'Valencia' },
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
(function() {
|
|
70
|
+
const { Component, NgModule } = ng.core;
|
|
71
|
+
const { BrowserModule } = ng.platformBrowser;
|
|
72
|
+
const { platformBrowserDynamic } = ng.platformBrowserDynamic;
|
|
73
|
+
const { CommonModule } = ng.common;
|
|
74
|
+
|
|
75
|
+
@Component({
|
|
76
|
+
selector: 'app-root',
|
|
77
|
+
template: '<nexa-viewer id="viewer" minimal></nexa-viewer>'
|
|
78
|
+
})
|
|
79
|
+
class AppComponent {
|
|
80
|
+
ngAfterViewInit() {
|
|
81
|
+
const viewer = document.getElementById('viewer');
|
|
82
|
+
viewer.definition = reportDef;
|
|
83
|
+
viewer.data = data;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@NgModule({
|
|
88
|
+
imports: [BrowserModule],
|
|
89
|
+
declarations: [AppComponent],
|
|
90
|
+
schemas: [ng.core.CUSTOM_ELEMENTS_SCHEMA],
|
|
91
|
+
bootstrap: [AppComponent]
|
|
92
|
+
})
|
|
93
|
+
class AppModule {}
|
|
94
|
+
|
|
95
|
+
platformBrowserDynamic().bootstrapModule(AppModule);
|
|
96
|
+
})();
|
|
97
|
+
</script>
|
|
98
|
+
</body>
|
|
99
|
+
</html>
|