From 2dd260fc51c4fe1905720de5a7441684275541a9 Mon Sep 17 00:00:00 2001 From: atif118-mfsys Date: Tue, 13 Jan 2026 11:12:46 +0500 Subject: [PATCH] added export to excel functionality in transaction logs --- .../transaction-logs/transaction-logs.component.html | 3 +++ .../transaction-logs/transaction-logs.component.ts | 11 ++++++++++- src/app/utils/app.constants.ts | 4 +++- src/index.html | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/app/transaction-logs/transaction-logs.component.html b/src/app/transaction-logs/transaction-logs.component.html index 4d65ccb..defdfb3 100644 --- a/src/app/transaction-logs/transaction-logs.component.html +++ b/src/app/transaction-logs/transaction-logs.component.html @@ -21,6 +21,9 @@
{{'transactionLogs' | translate}} +
+ +
diff --git a/src/app/transaction-logs/transaction-logs.component.ts b/src/app/transaction-logs/transaction-logs.component.ts index d999918..1b4f450 100644 --- a/src/app/transaction-logs/transaction-logs.component.ts +++ b/src/app/transaction-logs/transaction-logs.component.ts @@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core'; import { TransactionLogService } from '../shared/services/transaction-log.service'; import { CommonModule } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; +import { ExcelExportService } from '../shared/services/excel-export.service'; +import { TRANSACTION_LOGS_FILE_NAME } from '../utils/app.constants'; interface TransactionLog { logId: number; @@ -31,7 +33,10 @@ export class TransactionLogsComponent implements OnInit { isLoading = false; errorMessage: string = ''; - constructor(private transactionLogService: TransactionLogService) {} + constructor( + private transactionLogService: TransactionLogService, + private excelExportService: ExcelExportService + ) {} ngOnInit(): void { this.loadLogs(); @@ -53,4 +58,8 @@ export class TransactionLogsComponent implements OnInit { } }); } + + exportDataInExcel(){ + this.excelExportService.exportExcel(this.logs, TRANSACTION_LOGS_FILE_NAME) + } } \ No newline at end of file diff --git a/src/app/utils/app.constants.ts b/src/app/utils/app.constants.ts index c93736a..9684b7a 100644 --- a/src/app/utils/app.constants.ts +++ b/src/app/utils/app.constants.ts @@ -35,4 +35,6 @@ export const EXCEL_FILE_TYPE = 'application/vnd.openxmlformats-officedocument.sp export const EXCEL_FILE_EXTENSION = '.xlsx'; -export const LOGGING_DETAILS_FILE_NAME = 'logging-manager-details' +export const LOGGING_DETAILS_FILE_NAME = 'logging-manager-details'; + +export const TRANSACTION_LOGS_FILE_NAME = 'transaction-logs-details'; diff --git a/src/index.html b/src/index.html index 2a3529c..aa569e3 100644 --- a/src/index.html +++ b/src/index.html @@ -5,7 +5,7 @@ ACONNECTUX - +