> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# IT Reports

> Create and manage IT operational report definitions — view run history, trigger on-demand runs, and edit definitions for assets, tickets, licenses, and more.

The IT Reports page (`/it/reports`) lists saved IT report definitions with options to view, run, edit, and delete reports. Reports can cover asset inventory, ticket summary, license compliance, security posture, vendor summary, change summary, or custom types.

## Overview

The page loads saved report definitions via `useReportDefinitions`. Each report card displays the report name, type label, optional description, column count, schedule badge (if `schedule_enabled`), and last-run time. Actions available from the card's overflow menu: **View Details** (`/it/reports/:id`), **Edit** (`/it/reports/:id/edit`), **Delete** (with confirmation dialog). A **Run** button on each card also navigates to the detail page.

**Report types** (code-defined): `asset_inventory`, `ticket_summary`, `license_compliance`, `security_posture`, `vendor_summary`, `change_summary`, `custom`.

## Who it's for

No explicit secondary permission gate beyond the outer `ITViewGuard` (`it.view`). Creating reports requires `it.reports.create`.

## Before you start

* Ensure you have the IT module permission (`it.view`) to view reports.
* Click **New Report** to build a report definition for the first time.

## Steps

<Steps>
  <Step title="Open IT Reports">
    Navigate to `/it/reports`.
  </Step>

  <Step title="Browse report definitions">
    Each card shows the report name, type, description, number of columns, schedule status, and when it was last run.
  </Step>

  <Step title="Run a report">
    Click **Run** on a report card, or click the report name to open the detail page at `/it/reports/:id`.
  </Step>

  <Step title="Edit a report definition">
    From the overflow menu (three dots), click **Edit** to navigate to `/it/reports/:id/edit`.
  </Step>

  <Step title="Delete a report">
    From the overflow menu, click **Delete**. Confirm in the dialog. This action cannot be undone.
  </Step>

  <Step title="Create a new report">
    Click **New Report** to navigate to `/it/reports/new`.
  </Step>
</Steps>

## Key concepts

| Concept            | Description                                                                     |
| ------------------ | ------------------------------------------------------------------------------- |
| `ReportType`       | Enumeration of report categories; each maps to a label via `REPORT_TYPE_LABELS` |
| `schedule_enabled` | Indicates the report has a scheduled run configuration                          |
| `last_run_at`      | ISO timestamp of the most recent report execution                               |
| `columns`          | Array defining which data columns appear in the report output                   |

## Viewing a report

The Report Details page (`/it/reports/:id`) has two tabs: **Overview** (description, selected columns, schedule configuration, metadata) and **Run History** (table of previous runs with status, type, started time, row count, and download link for completed runs). The **Run Now** button triggers an on-demand run using `useReportRunMutations`. The Edit button navigates to `/it/reports/:id/edit`. Deleting a report navigates back to `/it/reports`.

1. Navigate to **IT > Reports** and click a report name, or navigate directly to `/it/reports/:id`.
2. Review the **Overview** tab: column selection, schedule settings, and creation metadata.
3. Click **Run Now** to trigger an immediate report run.
4. Switch to the **Run History** tab to see the status of all previous runs.
5. Click the download icon on a completed run to retrieve the output file.
6. Click **Edit** to modify the report definition.

**Key fields:**

* **ReportType** — the data source/domain for the report (`asset_inventory`, `ticket_summary`, `license_compliance`, `security_posture`, `vendor_summary`, `change_summary`).
* **ReportRunStatus** — `pending | running | completed | failed`.
* **run\_type** — whether the run was manual or scheduled.
* **row\_count** — the number of data rows in a completed run result.
* **file\_url** — the download URL for a completed run's output file.

## Creating a report

The New Report page (`/it/reports/new`) is a three-step wizard (Type → Columns → Details). On success the user is redirected to the new report's detail page at `/it/reports/:id`.

Available report types: `asset_inventory`, `ticket_summary`, `license_compliance`, `security_posture`, `vendor_summary`, `change_summary`.

Before you start: decide which report type matches the data you want to analyze and know which columns are most relevant.

1. Navigate to **IT > Reports** and click **New Report**, or go directly to `/it/reports/new`.
2. **Step 1 — Type:** Select a report type (Asset Inventory, Ticket Summary, License Compliance, Security Posture, Vendor Summary, or Change Summary).
3. Click **Next**.
4. **Step 2 — Columns:** Check the columns you want included. Use **Select All** to include every available column for that type. At least one column is required.
5. Click **Next**.
6. **Step 3 — Details:** Enter a **Report Name** (required) and an optional description. Toggle **Enable scheduled runs** if you want the report to run on a schedule.
7. Click **Create Report**. On success you are redirected to the report detail page.

**Key concepts:**

* **Report type** — determines the data source and available columns; governed by `ReportType` in `src/cores/it/types/dashboard.ts`.
* **Columns** — the subset of available columns for the chosen report type, stored as `columns: string[]`.
* **Scheduled runs** — the `schedule_enabled` flag; schedule configuration details are managed on the report detail page.

## Editing a report

The Edit Report page (`/it/reports/:id/edit`) loads an existing report definition via `useReportDefinition`. The form is organized into scrollable tabs (`ScrollableTabsList`). Fields include: name, description, report type (`asset_inventory`, `ticket_summary`, `license_compliance`, `security_posture`, `vendor_summary`, `change_summary`, `custom`), columns (multi-select from `REPORT_COLUMNS`), grouping, and schedule settings including a `schedule_enabled` flag. On save, `updateReport` is called and the user is redirected to the reports list. A loading skeleton is shown while data loads; an error state appears if the report is not found.

Permission required: `IT_PERMISSIONS.VIEW` via the outer `ITViewGuard`. No additional per-route gate.

1. From the report list or detail page, navigate to `/it/reports/:id/edit`.
2. Modify the report name, description, and report type as needed.
3. Use the column checkboxes from `REPORT_COLUMNS` to include or exclude columns in the output.
4. Toggle `schedule_enabled` and set any schedule parameters.
5. Click **Save** to update the report definition. On success, you are redirected.

**Key fields:**

* **report\_type** — Values: `asset_inventory`, `ticket_summary`, `license_compliance`, `security_posture`, `vendor_summary`, `change_summary`, `custom`.
* **REPORT\_COLUMNS** — Set of available column identifiers defined in `src/cores/it/types/dashboard.ts`.
* **schedule\_enabled** — Boolean; SME should confirm delivery mechanism.

## Related

<Columns cols={2}>
  <Card title="IT Service Management" icon="headset" href="/it/overview">
    IT Service Management overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index" />
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/it.tsx
  * src/cores/it/pages/reports/ReportListPage.tsx
  * src/cores/it/pages/reports/ReportDetailPage.tsx
  * src/cores/it/pages/reports/NewReportPage.tsx
  * src/cores/it/pages/reports/EditReportPage.tsx
  * src/cores/it/hooks/useReportDefinitions.ts
  * src/cores/it/hooks/useReportRuns.ts
  * src/cores/it/types/dashboard.ts
</Accordion>
