Keyword Index

© 2004-2012 Metamatica Software

Using parameters in SQL statements

Top  Previous  Next


If you are accustomed to SQL,  you know that a SQL statement can have parameters. The report designer allows using parameters too. The following example shows such a SQL query, which has a parameter "CustomerNo" (preceded by a ":" as usual):




You can now press the "Parameter" button to open the following dialog:




Here you can define the type of the parameter:


Value: The supplied value is used for the parameter when generating the report.


Ask for value before print: Use this option to make the report engine ask for the parameter value each time before the report is printed. A dialog with an input line for the parameter value will be shown. This way the report can be filtered individually before printing for example.


Assign value from master dataset: This option is for retrieving the parameter value from another dataset, which means the parameter name corresponds to the field name in another table or query. In the current query's property dialog you must set the "Master" property to the master dataset.


To assign query parameters before starting report you can use report parameters dialog box.