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

# Correct a Report

> Understand why generated Reports cannot be edited and how to correct the source setup before generating a new Report.

A generated Report is a historical file. Reporter does not edit the generated output after generation finishes.

## Objective

***

Correct the source setup that produced a wrong Report, then generate a new Report.

For example, if a CSV file is missing rows, review the filters used during generation. If the layout is wrong, update the Template. If values are wrong, test the Data Source and confirm it points to the expected database and schema.

## When to use

***

Use this page when:

* an operator asks why a generated Report cannot be changed directly;
* a generated Report has wrong data, layout, or output format;
* an `Error` or stalled `PendingExtraction` Report needs investigation before trying again;
* the team needs a corrected file while preserving the original generated Report for history.

Do not use this task to overwrite a generated file. Generate a new Report after correction.

## Before you start

***

Identify what is wrong:

| Problem                                                      | Likely source to check                                 |
| ------------------------------------------------------------ | ------------------------------------------------------ |
| File layout is wrong                                         | Template structure or `.tpl` file                      |
| Output format is wrong                                       | Template **Output Format**                             |
| Rows are missing                                             | Report filters or Data Source schema                   |
| Values are wrong                                             | Data Source connection, schema, fields, or source data |
| Generation returned `Error` or stayed in `PendingExtraction` | Report details, Template, Data Source, filters         |

<Note>
  The original Report remains available for audit history. The corrected file is a new generated Report.
</Note>

## Step by step

***

<Steps>
  <Step title="Open the Report details">
    Go to **Reports** and open the generated Report details.
  </Step>

  <Step title="Review how it was generated">
    Check the Template, filters, output format, status, and any error details.
  </Step>

  <Step title="Fix the source setup">
    Update the Template, test or edit the Data Source, or adjust the filters you will use during the next generation.
  </Step>

  <Step title="Generate a new Report">
    Use the corrected Template, Data Source, and filters to generate a new Report.
  </Step>

  <Step title="Download the corrected file">
    Wait until the new Report reaches `Finished`, then download it.
  </Step>
</Steps>

## Field guide

***

| Field or status | What it helps diagnose                                                                                                                              | Example                  |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| Template        | Whether the correct Template and output format were used. Technical fields include `templateId`, `templateDescription`, and `templateOutputFormat`. | `Monthly tax CSV`, `csv` |
| Filters         | Whether the generated Report included the intended data subset. Technical field: `filters`.                                                         | `status eq active`       |
| Status          | Whether the Report completed, is still running, is waiting on extraction, or returned an error. Technical field: `status`.                          | `Error`                  |
| Error details   | Message returned by Reporter when generation fails. Technical field: `error`.                                                                       | `connection timeout`     |
| Data Source     | Whether the Report came from the expected database and schema. Check the filter `database` and the Template field mapping.                          | `production-postgres`    |

## Expected result

***

The incorrect Report stays unchanged, and a new corrected Report is generated from the fixed setup.

## Common errors and care points

***

<AccordionGroup>
  <Accordion title="Trying to edit the generated file">
    Reporter keeps generated Reports as historical outputs. Correct the Template, Data Source, or filters, then generate again.
  </Accordion>

  <Accordion title="Fixing the Template when the filter was wrong">
    Missing rows often come from filters, not from the Template. Review the generation inputs before changing the Template.
  </Accordion>

  <Accordion title="Regenerating without testing the Data Source">
    If values are wrong or schema access changed, test the Data Source before generating a corrected Report.
  </Accordion>
</AccordionGroup>

## Next steps

***

* Use [Update a Template](/en/lerian-console/reporter-console/updating-a-template) when layout or output format is wrong.
* Use [Testing a Data Source](/en/lerian-console/reporter-console/testing-a-data-source) when values or schema access are suspect.
* Use [Generate a Report](/en/lerian-console/reporter-console/generating-a-report) after fixing the source setup.

<CardGroup cols={2}>
  <Card title="Create report" icon="code" href="/en/reference/reporter/create-report">
    Generate the corrected Report. There is no direct edit API for historical outputs.
  </Card>

  <Card title="Check report status" icon="code" href="/en/reference/reporter/check-report-status">
    Monitor the corrected Report before download.
  </Card>
</CardGroup>
