|
|
@@ -1,3 +1,4 @@
|
|
|
+import { ExportExcellService } from './../../services/export-excell.service';
|
|
|
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
|
|
import { MatIconRegistry } from '@angular/material/icon';
|
|
|
import { MatPaginator } from '@angular/material/paginator';
|
|
|
@@ -12,6 +13,7 @@ import { consultarRegistroService } from '../../services/consultarRegistro.servi
|
|
|
import { registroAlumnoComponent } from '../../../Padres/pages/registroAlumno/registroAlumno.component';
|
|
|
import { PersonalizarService } from '../../services/personalizar.service';
|
|
|
|
|
|
+
|
|
|
@Component({
|
|
|
selector: 'app-consultar-registro-acay-admi',
|
|
|
templateUrl: './consultar-registro-acay-admi.component.html',
|
|
|
@@ -39,26 +41,31 @@ url2: string | null = '';
|
|
|
private _enviarInfo: EnviarInfoService,
|
|
|
private _consultarRegistro: consultarRegistroService,
|
|
|
private personalizarService : PersonalizarService,
|
|
|
+ private exportExcell : ExportExcellService,
|
|
|
private _registroService: RegistroAcademicoService,
|
|
|
private _registroAlumno: registroAlumnoComponent) {
|
|
|
this._MatIconRegister.addSvgIcon('excel', this._DomSanitizer.bypassSecurityTrustResourceUrl('assets/icons/excel.svg'));
|
|
|
|
|
|
}
|
|
|
- exportAsExcel() {
|
|
|
- const ws: XLSX.WorkSheet = XLSX.utils.table_to_sheet(this.table.nativeElement);
|
|
|
- const wb: XLSX.WorkBook = XLSX.utils.book_new();
|
|
|
- XLSX.utils.book_append_sheet(wb, ws, 'COLEGIOABC-ConsultaRegistroAcademico/Administrativo');
|
|
|
- XLSX.writeFile(wb, 'RegistroAcademico/Administrativo.xlsx');
|
|
|
- }
|
|
|
+
|
|
|
//exportar toda la data a excel
|
|
|
- exportAll() {
|
|
|
- const dataSource = this.dataSource.data;
|
|
|
- const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet(dataSource);
|
|
|
- const wb: XLSX.WorkBook = XLSX.utils.book_new();
|
|
|
|
|
|
- XLSX.utils.book_append_sheet(wb, ws, 'COLEGIOABC-ConsultaRegistroAcademico/Administrativo');
|
|
|
- XLSX.writeFile(wb, 'RegistroAcademico/Administrativo.xlsx');
|
|
|
- }
|
|
|
+exportarTodo() {
|
|
|
+ this.exportExcell.getConsultarRegistro().subscribe((response: any) => {
|
|
|
+ const datos = response.data.map((item: any) => ({
|
|
|
+ 'ID Usuario': item.idUsuario,
|
|
|
+ 'Nombre Completo': item.nombreCompleto,
|
|
|
+ 'Quién Registró': item.quienRegistra,
|
|
|
+ 'Última Actualización': item.ultActualizacion,
|
|
|
+ 'Académico Completo': item.registroAcCompleto,
|
|
|
+ 'Administrativo Completo': item.registroAdCompleto
|
|
|
+ }));
|
|
|
+
|
|
|
+ // Aquí sí usas tu servicio ExportExcell
|
|
|
+ this.exportExcell.exportJsonToExcel(datos, 'AlumnosRegistro');
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
applyFilter(event: Event) {
|
|
|
const filterValue = (event.target as HTMLInputElement).value;
|