Table of Contents
REPORT Statement
Valentina can generate reports using Valentina SQL for Valentina DB databases (v4 or later) or any datasource supported by the Valentina Reports Engine (v6.2 or later). Most parameters are similar to "SELECT ... FOR REPORT" , but there are some additional ones.
Syntax
vext_report_stmt -- v6.2 : REPORT project_name.report_name FROM data_source USING data_query [AS report_format] [PAGES StartPage TO EndPage] [ENCODE BASE64] report_format : {PDF | HTML | JPG} data_source : character_string_literal_or_var data_query : character_string_literal_or_var
Arguments
data_source
Specifies a datasource which will be used to access the data for report. Read details about datasource here.
data_query
String literal which contains SQL query related to the specified data source. For example, working with MySQL you should use the syntax of MySQL, working with PostgreSQL using the syntax of PostgreSQL.
Examples
postgreSQL
REPORT project1.report_1 FROM 'postgresql://host=127.0.0.1, port=5432, dbname=db1, user=postgres, password=postgres, timeout=0' USING 'SELECT * FROM T1 WHERE f1 = 5 AND f2 > 100' AS PDF
SQLite
REPORT project1.report_1 FROM 'sqlite://c:/somedb.sqlite' USING 'SELECT * FROM T1 WHERE f1 = 5 AND f2 > 100' AS PDF
VServer
REPORT project1.report_1 FROM 'vserver://host=127.0.01, user=sa, pass=sa, dbname=untitled, port=17432, timeout=10, ssl=false' USING 'SELECT * FROM "T1" WHERE f1 LIKE ''%John%''' AS HTML