sonar-export-report

Generates a report file based on a report template and saves it to the specified path.

Command properties

ItemDescription
Command typeDriver query
Required permissionLogin required
License usageNot counted
Parallel executionNot supported
Distributed executionNot 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 document
  • html: HTML document
  • pdf: PDF document
  • hwpx: Hangul (HWP) document
from=STR
Start time of the report data range. Specify in yyyyMMddHHmmss format. Trailing digits can be omitted and are filled with zeros.
to=STR
End time of the report data range. Specify in yyyyMMddHHmmss format. Trailing digits can be omitted and are filled with zeros.
path=STR
Path where the report file will be saved

Output fields

FieldTypeDescription
file_pathstringPath of the generated report file
file_namestringName of the generated report file
file_sizelongSize of the generated report file (bytes)

Error codes

Parse errors
Error codeMessageDescription
300101유효하지 않은 세션입니다.The session is invalid or the user cannot be found.
300111template 옵션을 지정하세요.The template option is missing.
300112template 옵션 값은 GUID 형식이어야 합니다.The template option value is not in GUID format.
300113지정된 보고서 서식을 찾을 수 없습니다.No report template exists for the specified GUID.
300114from 옵션 값을 yyyyMMddHHmmss 형식으로 지정하세요.The from option is missing or has an invalid format.
300115to 옵션 값을 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 codeMessageDescriptionPost-processing
-report build task is cancelledThe report generation task was cancelled.Aborts the query.
-cannot find reportThe result cannot be found after report generation.Aborts the query.
-cannot write reportAn 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

  1. Generate a PDF report

    sonar-export-report template=550e8400-e29b-41d4-a716-446655440000 format=pdf from=20260301 to=20260401 path=/opt/logpresso/reports/monthly.pdf
    

    Generates a PDF report for March 2026 using the specified template.

  2. Generate a DOCX report

    sonar-export-report template=550e8400-e29b-41d4-a716-446655440000 format=docx from=20260317000000 to=20260317235959 path=/opt/logpresso/reports/daily.docx
    

    Generates a Word report for March 17, 2026 using the specified template.