---
tags: [reports, service]
module: Reports
---

# [Service]UtilityServices

## Connections
[[_Reports]] · [[[Controller]Controllers]] · [[[Service]FinancialServices]] · [[[Service]SummaryServices]] · [[[Repo]Repositories]] · [[[Cross]CrossModuleDependencies]]

## Source
`Modules/Reports/Services/`

Supporting services used across all reports — not report-specific.

---

## PreparingDataService

Injected into almost every report service. Provides the common form-level data shared by all report views.

**Dependencies:** `FiscalYearsRepository` · `RetrievingCurrentFinancialYearService` · `GeneralSettingsRepository` · `RetrievingCostCentersService` · `RetrievingTenantCurrencyService`

**Returns:** fiscal years list · current fiscal year · company name · comparison options (`ReportsComparisonEnum`) · cost centers · currency

---

## AddingToFavoritesService
**Dependency:** `FavoritesRepository`  
Creates a `Favorite` row for the authenticated user.

## RemovingFromFavoritesService
**Dependency:** `FavoritesRepository`  
Deletes the `Favorite` row by model instance.

---

## SubscriptionReportStatusService
Called in every controller before running a report. Checks whether the requested report is included in the tenant's subscription package via `AllowableReports` trait + `ReportsPackagesEnum`.  
Returns `403 / subscription gate view` if report not allowed.

---

## IndexingReportsService
Returns the full report list for the reports home page, respecting the subscription package.

---

## Exports

| Class | Purpose |
|---|---|
| ExcelViewExport | Generic Maatwebsite Excel export — renders a Blade view into an `.xlsx` file; sets RTL for Arabic locale |
| ExcelFlowChartDirectViewExport | Extends ExcelViewExport; adds column auto-sizing + alignment formatting for Cash Flow Direct report |
