-
Notifications
You must be signed in to change notification settings - Fork 74
Standalone usage
Eugene Degtyarjov edited this page Dec 15, 2015
·
35 revisions
One of YARG features is ability to use it as standalone application.
In this case you can run your reports from command line or from any types of applciations.
There are few steps to start use it this way.
- Download latest applciation distributive from releases
- Unzip the content to some folder
- Run the reporting engine with the following command:
yarg -rp PATH_TO_YOUR_REPORT_XML -op PATH_FOR_OUTPUT -PparamName=ParamValue
Please note, that if you path date to params, it should have one of the following formats: dd/MM/yyyy
or dd/MM/yyyy hh:mm
.
If you need to use database queries, you should do the following steps (the example is for PostgreSQL database):
- Put JDBC driver JAR to the lib subfolder. For PostgreSQL it would be postgresql-9.4.jar
- Add the JDBC driver JAR's path to CLASSPATH variable in the executable script (yarg or yarg.bat). For PostgreSQL you should add
%APP_HOME%\lib\postgresql-9.4.jar
. Please note, that separators are different for Linux(:) and Windows(;) - Create the reporting.properties file somewhere. The file should contain the following properties
cuba.reporting.sql.driver=org.postgresql.Driver #PostgreSQL driver name
cuba.reporting.sql.dbUrl=jdbc:postgresql://localhost/yarg #database url
cuba.reporting.sql.user=root #login
cuba.reporting.sql.password=root #password
cuba.reporting.openoffice.path=/usr/lib/libreoffice/program #path to OpenOffice, if you need to use doc and odt templates, and also if you need to convert result files to PDF
cuba.reporting.openoffice.ports=8100|8101 #OpenOffice ports to use
cuba.reporting.openoffice.timeout=60 #timeout for OpenOffice connections
cuba.reporting.openoffice.displayDeviceAvailable=false #just leave it as is)
The path of the reporting.properties should be passed as -prop argument of command line.
yarg -prop PATH_TO_PROPERTIES/reporting.properties -rp PATH_TO_YOUR_REPORT_XML -op PATH_FOR_OUTPUT -PparamName=ParamValue