sonar-export-report
Generates a report file based on a report template and saves it to the specified path.
Command properties
| Item | Description |
|---|---|
| Command type | Driver query |
| Required permission | Login required |
| License usage | Not counted |
| Parallel execution | Not supported |
| Distributed execution | Not supported |
Syntax
sonar-export-report template=STR format={docx|html|pdf|hwpx} from=STR to=STR path=STR
Options
template=STR- GUID of the report template
format={docx|html|pdf|hwpx}- Report file format
docx: Microsoft Word documenthtml: HTML documentpdf: PDF documenthwpx: Hangul (HWP) document
from=STR- Start time of the report data range. Specify in
yyyyMMddHHmmssformat. Trailing digits can be omitted and are filled with zeros. to=STR- End time of the report data range. Specify in
yyyyMMddHHmmssformat. Trailing digits can be omitted and are filled with zeros. path=STR- Path where the report file will be saved
Output fields
| Field | Type | Description |
|---|---|---|
file_path | string | Path of the generated report file |
file_name | string | Name of the generated report file |
file_size | long | Size of the generated report file (bytes) |
Error codes
Parse errors
| Error code | Message | Description |
|---|---|---|
| 300101 | 유효하지 않은 세션입니다. | The session is invalid or the user cannot be found. |
| 300111 | template 옵션을 지정하세요. | The template option is missing. |
| 300112 | template 옵션 값은 GUID 형식이어야 합니다. | The template option value is not in GUID format. |
| 300113 | 지정된 보고서 서식을 찾을 수 없습니다. | No report template exists for the specified GUID. |
| 300114 | from 옵션 값을 yyyyMMddHHmmss 형식으로 지정하세요. | The from option is missing or has an invalid format. |
| 300115 | to 옵션 값을 yyyyMMddHHmmss 형식으로 지정하세요. | The to option is missing or has an invalid format. |
| 300116 | 보고서 파일을 출력할 경로를 path 옵션으로 지정하세요. | The path option is missing. |
| 300117 | 보고서 파일 형식을 format 옵션으로 지정하세요. | The format option is missing. |
Runtime errors
| Error code | Message | Description | Post-processing |
|---|---|---|---|
| - | report build task is cancelled | The report generation task was cancelled. | Aborts the query. |
| - | cannot find report | The result cannot be found after report generation. | Aborts the query. |
| - | cannot write report | An I/O error occurred while saving the report file. | Aborts the query. |
Description
The sonar-export-report command generates a report based on the specified template and time range, then saves the result to the specified file path. Report generation is processed asynchronously; the command waits until generation is complete before rendering.
If the parent directory of the output path does not exist, it is created automatically.
Examples
-
Generate a PDF report
sonar-export-report template=550e8400-e29b-41d4-a716-446655440000 format=pdf from=20260301 to=20260401 path=/opt/logpresso/reports/monthly.pdfGenerates a PDF report for March 2026 using the specified template.
-
Generate a DOCX report
sonar-export-report template=550e8400-e29b-41d4-a716-446655440000 format=docx from=20260317000000 to=20260317235959 path=/opt/logpresso/reports/daily.docxGenerates a Word report for March 17, 2026 using the specified template.