Show reports depending on form values

When you open the report of the last section (the subreport section) you will see the data of all authors. But wouldn't it be nice to see and print only the data of the author currently displayed in the form? First create a "Report" button on the form "authorform". This button will open the report as shown below:

Figure 7.6. The form property showing the button values

The form property showing the button values

So far this is nothing special. Now click on the button with the 3 dots right of the 'object' field. The following dialog appears:

Figure 7.7. The reportcondition dialog

The reportcondition dialog

Here you can link the form data with the report. Select the column 'author_id' as report field, the form datasource 'authors' and the form field 'author_id'. Then press the button with the 2 arrows. That's all. Now the button opens the report as intended.

Important

This dialog allows you to connect report fields in two ways. Either with the value of a formdatasource-column as shown above or with a constant value. To do so let the 'form datasource' field empty and enter the constant value into the form field.