> ## 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.

# Platform Report Builder

> Visual SQL report builder for creating custom organization reports by selecting tables, columns, joins, and filters.

Interactive report builder at `/reports/builder` where users construct custom reports by selecting database tables, columns, joins, and filter conditions without writing raw SQL.

## Overview

The Report Builder page provides a visual interface for creating new organization reports. Users select one or more source tables via `TableSelector`, choose columns with `ColumnSelector`, define joins between tables via `JoinBuilder`, add filter conditions with `FilterBuilder`, and preview the generated SQL in `SQLPreview`. The report is saved with a name, description, and category (defaulting to `custom`). On save, the user is redirected back to the reports list. The page uses `useOrganization` to scope the saved report to the current organization.

## Who it's for

Access follows your organization's role and module configuration. ## Before you start

* You must be signed in to the platform.
* Understand which tables contain the data you need before building a report.

## Steps

1. Navigate to `/reports/builder`.
2. Enter a **Name** and optional **Description** for the report.
3. Select a **Category** (defaults to `custom`).
4. Add one or more source tables using the Table Selector.
5. Choose the columns to include from each selected table.
6. Define any joins between tables if using multiple tables.
7. Add filter conditions to narrow the data.
8. Review the SQL preview to confirm the query shape.
9. Click **Save** to create the report.

## Key concepts

**Report category** — A classification for organizing reports. The default is `custom`; other category values come from the `report_category` database enum.

**Join builder** — Defines how two tables are connected (e.g., shared key). SME: confirm supported join types.

**SQL preview** — A read-only view of the SQL that will be generated from your selections.

## Related

<Columns cols={2}>
  <Card title="Platform Foundation" icon="layer-group" href="/pf/overview">
    Platform Foundation 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/platform.tsx
  * src/platform/reports/ReportBuilder.tsx
  * src/platform/reports/components/TableSelector.tsx
  * src/platform/reports/useReportMutation.ts
</Accordion>
