Skip to content

ExportToExcelService

reference
1 min readUpdated

Kind: Class

Source: Frontend/src/app/services/common/export-to-excel.service.ts (line 13)

Part of: Frontend

ExportToExcelService handles Excel export actions for dashboard widgets. It exposes separate methods for standard widget exports and advanced widget exports, allowing dashboard components to trigger the appropriate export flow.

Methods

MethodSignatureReturns
exportingDashboardWidgetToExcelexportingDashboardWidgetToExcel(header: any[], data: any[], widgetName: string, isDataArrayIncludingTotal: boolean)void
exportingDashboardWidgetToExcelAdvancedexportingDashboardWidgetToExcelAdvanced(header: any[], headerProperty: string, data: any[], dataProperties: string[], widgetName: string)void

Properties

PropertyType
xlxsdataany[]
ExlRowExcelRow[]
headerany
valueany
subscriptionSubscription

Diagram

mermaid
graph LR
  DashboardWidget --> ExportToExcelService
  ExportToExcelService --> exportingDashboardWidgetToExcel
  ExportToExcelService --> exportingDashboardWidgetToExcelAdvanced
  exportingDashboardWidgetToExcel --> ExcelFile
  exportingDashboardWidgetToExcelAdvanced --> ExcelFile

Usage

typescript
import { ExportToExcelService } from '@app/services/common/export-to-excel.service';

export class DashboardComponent {
  constructor(private readonly exportToExcelService: ExportToExcelService) {}

  exportWidget(): void {
    this.exportToExcelService.exportingDashboardWidgetToExcel();
  }

  exportAdvancedWidget(): void {
    this.exportToExcelService.exportingDashboardWidgetToExcelAdvanced();
  }
}

AI Coding Instructions

  • Inject ExportToExcelService through the Angular constructor rather than creating it directly.
  • Call exportingDashboardWidgetToExcel() for the standard dashboard widget export path.
  • Call exportingDashboardWidgetToExcelAdvanced() only for widgets that require the advanced export path.
  • Keep widget-specific data preparation outside the service unless the export logic requires shared handling.

Used by

63 references from 63 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (63)

  • WidgetAccountsRunningOffersComponentFrontend/src/app/components/dashboard/dashboard-libary/widgets/widget-accounts-running-offers/widget-accounts-running-offers.component.ts:1
  • DataResponseFrontend/src/app/components/dashboard/dashboard-libary/widgets/widget-aging-receivables/widget-aging-receivables.component.ts:1
  • WidgetBacklogByAccountManagersComponentFrontend/src/app/components/dashboard/dashboard-libary/widgets/widget-backlog-by-account-managers/widget-backlog-by-account-managers.component.ts:1
  • WidgetBacklogByClientsComponentFrontend/src/app/components/dashboard/dashboard-libary/widgets/widget-backlog-by-clients/widget-backlog-by-clients.component.ts:1
  • WidgetBacklogByMarketSegmentsComponentFrontend/src/app/components/dashboard/dashboard-libary/widgets/widget-backlog-by-market-segments/widget-backlog-by-market-segments.component.ts:1
  • WidgetBacklogByMonthsComponentFrontend/src/app/components/dashboard/dashboard-libary/widgets/widget-backlog-by-months/widget-backlog-by-months.component.ts:1
  • WidgetBacklogByPrincipalsComponentFrontend/src/app/components/dashboard/dashboard-libary/widgets/widget-backlog-by-principals/widget-backlog-by-principals.component.ts:1
  • WidgetBacklogByProductTypesComponentFrontend/src/app/components/dashboard/dashboard-libary/widgets/widget-backlog-by-product-types/widget-backlog-by-product-types.component.ts:1

…and 55 more.

Was this page helpful?

Download as PDF