Description

Allows you to enter an SQL query for the report, and select the file defines the appearance and logic of the report.

*To work with reports, you must have knowledge of the query language SQL.


Let us consider the principle of report setup. Let's say you need to print out all clients with their all payments.


  1. Enter SQL query.
  2. Since no template for this report has been created yet, let's leave the "Select report file" option as shown in the above figure.
  3. Launch the project and click the button to which the "Report (SQL)" action has just been assigned.
  4. You will see a report designer, where you need to create a report template, and save it to the "Report" folder, which is located in your project folder. You can read about how to work with the report designer in the Report section. The example "How to print a master-detail report with grouping" is most suitable for this SQL query. Also, detailed documentation on working with the report designer can be found here https://www.fast-report.com/public_download/UserManual-en.pdf
  5. After you have created a report template, go back to the Action button property and select your template file from the "Select report file" list. Now when you click the button, you will see your finished report.


As you may have noticed, we have not yet used another option called "Select the Table Grid".


This option allows you to obtain a record ID for your SQL query from the required table component. Let's say you need to print payments only from a client that you select from a TableGrid component. To do this, you need to add: WHERE clients.id=$id to your SQL query, where $id is the record identifier from the "clients" table, which will be substituted automatically.

The same result can be obtained if this button with the same settings is placed on the form for adding/editing the client, where the $id value is automatically assigned an identifier of the current record. In this case, leave the option "Select the Table Grid" empty.



Additionally

If necessary, you can insert data from visual components into SQL query, read more about it in section SQL query.