The following pair of methods was added into v4.9 of all Valentina ADKs.

This pair of methods allows specifying any data source to be used in a report with the help of inDataSource parameter. This parameter is a string starting with the prefix, which specifies a kind of data source, and suffix that contains information, required to open or connect that data source.

Valentina Server, MySQL, and PostgreSQL server data sources support SSL connection, just add ssl = 'true' to the data source string.
PostgreSQL will search for certificate and private key at the standard paths in the user's home directory.
For MySQL it is possible to define these paths explicitly, using following parameters: ssl_key_path, ssl_cert_path, ssl_ca_path.

NOTES:

Parser of this connection string allows you to write string literals with OR without single quotes. Inside of single-quoted literal, you can use escape character to escape single quote.

You can use ',', ';' or spaces as delimiters of parameters. Delimiting spaces are allowed only for strings with values, that are single-quoted.

If a value contains any delimiter (',', ';', ' '), either escape it or take the whole value to single quotes.

For PostgreSQL data source you can use any parameter, supported by PostgreSQL native connection string.

inQuery - The SQL string of a query or NULL to use query prepared by VStudio and stored in the VProject.

inBinds - The array of bind parameters. Usually, this is an array of Strings or array of VARIANTs. See API Reference specific to your language.

Description:

This method plays the role of a VReport class factory. It returns a VReport class instance for the Nth report of this project. It will return NULL if the specified report is not found.

To create a report instance, the VREPORT DLL has to know:

Datasource that will be used to get data.

Query that should be executed to get data. Can be NULL to use query stored in the VProject.

Parameter inQuery has to contain any SQL that returns a VCursor. Usually, this is a SELECT statement, although it can be a SHOW statement or a CALL procedure that returns cursor.

Parameter inQuery can be NULL by default. In this case, the Report will use the original query, which is stored in the VProject, i.e. the same query used in the Report Editor, when this report was designed. You still can provide another query with the help of this parameter. For example, you can change the WHERE statement to select other records. In fact, you can use very different database and table, the only thing important is that the cursor should have fields with the same names as report expects.

IMPORTANT: When designing a report in Valentina Studio Pro, you assigned a SQL SELECT query to this report. You used the fields returned by that cursor to build the layout of this report. But that was in DESIGN mode.

Now, in RUNTIME mode, you can provide a completely different database and use a completely different query. The only requirement is that the query used produces a cursor with the same field names as the field names used by the report layout. If not the report will produce nothing for 'unmatched' fields.