Displaying Field Values from Parent’s Record or Current Row in a Table

Selecting the query as the parent tag’s record allows a Record or Table tag to aggregate data retrieval for a collection of enclosed FieldValue tags.

The selection criteria of the control’s associated Record control or Table control are used.  This option allows you to select a database field based on the surrounding Record tag properties you previously specified.  You do not need to specify the source of the record repeatedly for each of the field values contained in the record.

This is common for FieldValue tags enclosed within a surrounding Record or Table tag where the objective is to display a related set of fields coming from a single selected record.  In this case, the Record or Table tag specifies the record that is selected and the FieldValue controls display the individual fields.

<GEN:Record Name=”Customer”>

        <td><GEN:FieldValue Name="FirstName"/></td>

        <td><GEN:FieldValue Name="LastName"/></td>

        <td><GEN:FieldValue Name="Address"/></td>

        <td><GEN:FieldValue Name="City"/></td>

        <td><GEN:FieldValue Name="State"/></td>

        <td><GEN:FieldValue Name="ZipCode"/></td>

        <td><GEN:FieldValue Name="Country"/></td>

</GEN:Record>

The record retrieved by the parent tag – a Record tag or Table tag – determines the data displayed for the enclosed FieldValue tags.

In this example, the customer information is sourced from a single record in the Customers table and displayed on the web page.  The Record tag is bound to the Customers table.  The individual FieldValue tags are set to source their data from specific fields in the Customers table.

 

Specify the individual database fields to display for each FieldValue control on the Bindings tab in the Page Properties dialog.

This option also applies to the FieldValue tag if it is enclosed within a row of a table being displayed.  This is meaningful in the context of a FieldValue tag in a table in which the "current row" in the table is bound to a particular record.  As the table iterates over each record in the result set, each corresponding record is fetched and the appropriate field values retrieved and displayed.

Furthermore, you can add additional criteria to further filter the previously defined query or the records from the table.

See Also

Query Properties

Sourcing From URL Parameters

Creating Multi-Table Joins