Table of Contents
Report Editor - Command Line Interface Help
Command line interface allows you to work with reports from the terminal or automation (batch, bash) scripts.
Keys should start with “-” sign. Values, if necessary, are specified after space, next to the key. Some keys can be optional.
Printing to Disk
To print a report to disk the following command can be used:
vstudio -project $project_location [-project_server $vserver] -make_new_report $report_name -datasource $datasource_string [-query $query_text] -print_to_disk $output_location -format $output_format [-start_page $start] [-end_page $end]
Keys description:
- -project – open a project at $project_location
- -project_server – URL of Valentina Server holding a project. Specified in the format of Valentina Server datasource string
- -make_new_report – generate a report with name $report_name
- -datasource – use $datasource_string to connect to the datasource
- -query – pass $query_text as a source query for report
- -print_to_disk – print generated report to specified $output_location
- -format – set $output_format, can be one of the list { kToPostscript, kToPDF, kToHTML, kToLatex, kToSVG, kToPicture_GIF, kToPicture_JPG, kToPicture_PNG, kToPicture_TIFF, kToPicture_BMP }
- -start_page – set start page
- -end_page – set end page
Internally keys and values are mapped the API calls with appropriate parameters:
- -project – to VProject constructors
- -make_new_report – to VProject.MakeNewReport
- -print_to_disk – to VReport.PrintToDisk
Format of the datasource string is described here.
Examples
Printing a report from local project to disk on OS X:
$ "./Valentina Studio.app/Contents/MacOS/Valentina Studio" \ -project "/Users/user/Documents/project1.vsp" \ -make_new_report "Report_1" \ -datasource "mysql://host = 'localhost' port = '3306' dbname = 'sakila' user = 'root' password = 'root' timeout = '5'" \ -query "SELECT * FROM actor" \ -print_to_disk "/Users/user/Documents/report1.pdf" \ -format kToPdf
Printing a report from server project to disk on OS X:
$ "./Valentina Studio.app/Contents/MacOS/Valentina Studio" \ -project "project1.vsp" \ -project_server "vserver://host = 'localhost' port = '15432' user = 'sa' password = 'sa'" \ -make_new_report "Report_1" \ -datasource "mysql://host = 'localhost' port = '3306' dbname = 'sakila' user = 'root' password = 'root' timeout = '5'" \ -query "SELECT * FROM actor" \ -print_to_disk "/Users/user/Documents/report1.pdf" \ -format kToPdf