Skip to content

ExportToExcelService

reference
1 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/services/common/export-to-excel.service.ts (line 11)

Part of: Pams

ExportToExcelService exposes methods for exporting dashboard widgets to Excel, including an advanced export path. Dashboard components call this service when an export action is requested, keeping export behavior outside UI handlers.

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
    Dashboard[Dashboard Widget] --> Service[ExportToExcelService]
    Service --> Standard[exportingDashboardWidgetToExcel()]
    Service --> Advanced[exportingDashboardWidgetToExcelAdvanced()]
    Standard --> Excel[Excel Export]
    Advanced --> Excel

Usage

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

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

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

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

AI Coding Instructions

  • Inject ExportToExcelService into dashboard-facing components instead of placing export logic in click handlers.
  • Call exportingDashboardWidgetToExcel() for the standard dashboard widget export flow.
  • Call exportingDashboardWidgetToExcelAdvanced() only where the advanced export flow is intended.
  • Check the service implementation before adding arguments, error handling, or loading-state behavior to callers.

Used by

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

Imported by (2)

  • SortingArrayPams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/widget-booking-vstarget-today/widget-booking-vstarget-today.component.ts:1
  • WidgetTeamsTargetComponentPams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/widget-teams-target/widget-teams-target.component.ts:1

Was this page helpful?

Download as PDF