Partager via


How to: Assign Structured Metadata to Report Controls

The default Report Builder application allows you to assign structured metadata to individual report controls and layout bands.

Metadata XML for report elements is stored in the STYLE field of the report structure table (.frx or .lbx). For more information about report and label tables, see Understanding and Extending Report Structure.

Note

Reporting metadata XML documents are instances of Visual FoxPro's Memberdata XML Schema (.xsd), which also specifies metadata document format for Visual FoxPro Class and Property extensibility. For the full Memberdata Schema, see MemberData Extensibility.

The ReportBuilder.App permits direct text editing of the full XML memberdata element for a report control. It also exposes two supported attributes of Reporting metadata for convenient editing:

  • The Run-time extensions attribute can be used to store executable script.

  • The Execute When attribute can be used to specify an expression that ReportListener method code can evaluate in order to conditionally execute.

Just as it does not directly use the contents of the User Data field, the Report Engine does not reference report XML metadata directly. You can make use of the metadata in custom methods of a ReportListener object when running a report or label layout in object-assisted mode. For more information, see Understanding Visual FoxPro Object-Assisted Reporting. You can also write Report Builder extensions that use the metadata during report design sessions. For more information, see Report XML MemberData Extensions.

To assign Run-time extensions and Execute When metadata attributes to a report control

  1. Open the report or label in the appropriate designer.

  2. In the designer, double-click the report control to which you want to add user data.

    The Properties dialog box for the report control opens.

    Note

    If the _REPORTBUILDER system variable is not set to the default Report Builder or is set to a third-party builder, the Report Control dialog box displays or a different dialog box might display. For more information, see _REPORTBUILDER System Variable.

    Note

    The dialog box that appears when there is no report builder set does not include the ability to edit the report metadata.

  3. In the Report Control Properties dialog box, click the Other tab if it is not selected.

  4. In the Run-time extensions area, click Edit settings.

    The Run-time extensions dialog box for the report band opens.

  5. In the Run-time extensions edit box, type your script or run-time extension data. In the Execute When expression box, you can enter a value or expression that can be used by custom ReportListener classes at run-time.

  6. When you are finished, click OK.

For more information, see Other Tab, Report Control Properties Dialog Box (Report Builder).

To edit the metadata XML directly

  1. Open the report or label in the appropriate designer.

  2. In the designer, double-click the report control to which you want to add user data.

    The Properties dialog box for the report control opens.

    Note

    If the _REPORTBUILDER system variable is not set to the default Report Builder or is set to a third-party builder, the Report Control dialog box displays or a different dialog box might display. For more information, see _REPORTBUILDER System Variable. The default Report Builder also allows you to specify a different dialog box for metadata XML editing. For more information, see Report Builder Event Handler Registry Table.

    Note

    The dialog box that appears when there is no report builder set does not include the ability to edit the report metadata.

  3. In the report control properties dialog box, click the Other tab if it is not selected.

  4. In the Run-time extensions area, click Edit settings.

    The Run-time extensions dialog box for the report band opens.

  5. In the Run-time extensions dialog box, click Edit XML.

    The Metadata XML dialog box opens. If previously there was no metadata assigned to the selected control, the ReportBuilder places an empty XML template into the edit box.

  6. Enter values against the metadata attributes.

  7. When you are finished, click OK.

  8. For more information about the supported Reporting metadata XML document format, see the XML schema in MemberData Extensibility.

See Also

Tasks

How to: Add User Data to Report Controls

Other Resources

Managing Report Controls

Configuring Report Controls

Working with Report Controls