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

# Get the report data

> Retrieve Business Process Reporting data as BatchState and BatchRouting CSV files from FlexiCapture file storage and configure automatic data cleanup.

ABBYY FlexiCapture provides the data as CSV (comma-separated values) files. The files are placed in the FlexiCapture file storage directory, in a separate folder for each tenant that has the feature enabled. The folder path is `TenantName\Reporting`, where `TenantName` is the tenant's actual name.

Two types of data files are provided:

* `BatchState_YYYY-MM-DD HH-MM.csv` – Current batch states. The second part of the name is the date and time of the state in the file. This file contains the states for all batches present in the system at that moment.
* `BatchRouting_YYYYMMDD-YYYYMMDD.csv` – The list of stages each batch has been through. The second part of the name is the period covered by the file. The batch routing file is created for the previous 24-hour calendar day.

<Note>
  If the specified file is already present in the catalog, the file creation task is skipped.
</Note>

The interval (in milliseconds) after which the files are created is controlled by the registry key `ServerShadowActivityManagerProcessBatchReportingPeriod`, located at `HKLM\Software\Flexicapture\12.0\FlexiBR`. By default, files are created every 4 hours.

## Automatic data cleanup

Starting from ABBYY FlexiCapture 12 Release 4 Update 2, a cleanup feature for old data is available. It removes report files older than a specified period (180 days by default) from all tenants.

To change this period, edit the `CleanUpReportDataOlderDays` key at `Computer\HKEY_LOCAL_MACHINE\SOFTWARE\ABBYY\FlexiCapture\12.0\FlexiBr`. The same key controls the cleanup of both business process reports and performance and processing reports.

You can specify cleanup parameters in registry keys on machines where Processing Servers are installed. These keys are located at `Computer\HKEY_LOCAL_MACHINE\SOFTWARE\ABBYY\FlexiCapture\12.0\FlexiBr`.

You can modify the following parameters:

* `ServerShadowActivityManagerCleanUpOldReportingFilesMaxTasksCount` – The maximum number of cleanup tasks that can run simultaneously. The default is 1, so a new cleanup task cannot start until the previous one completes.
* `ServerShadowActivityManagerFirstCleanUpOldReportingFilesPeriod` – The interval between the launch of the Processing Server and the first cleanup task, in milliseconds. The default is 11 minutes. If set to 0, no automatic cleanup tasks are launched.
* `ServerShadowActivityManagerOtherCleanUpOldReportingFilesPeriod` – The interval between consecutive automatic cleanup tasks, in milliseconds. The default is 24 hours.
