Selecting the template to use

Using the Export.XHTML. UseTemplate property

The Data Export page in the Properties view lets you set properties for exporting data in XHTML. The names of all templates that you create and save for the current DataWindow object display in the Use Template drop-down list.

In addition to the properties that you can set on this page, you can use the Export.XHTML.TemplateCount and Export.XHTML.Template[ ].Name properties to let the user of an application select an export template at runtime. See “Selecting XHTML export templates at runtime”.

You can specify the template you want to apply to the default XML Web DataWindow or XHTML Web DataWindow generation at runtime by setting the Export.XHTML.UseTemplate property. You set the property using the Data Export tab in the DataWindow painter’s Properties view by selecting XHTML as the format and then selecting the XHTML export template’s name from the Use Template drop-down list box.

Shows the Data Export tab page of the DataWindow properties page with the Format to Configure and Use Template properties

You can also set the Export.XHTML.UseTemplate DataWindow property in script. For information, see “Selecting XHTML export templates at runtime”.

NoteIncorrect setting of the UseTemplate property If you set the Export.XHTML.UseTemplate property at runtime to the name of a template that does not exist, the built-in default Template is used on an export.

Properties related to XHTML export templates

Table 6-11 shows properties related to XHTML export templates.

Table 6-11: Properties for XHTML export templates

Property

User interface fields

Description

Export.XHTML. TemplateCount

Read only, so no user interface field.

The number of XHTML export templates associated with a DataWindow object

Export.XHTML. Template[num]. Name

Read only, so no user interface field.

The name of an XHTML export template associated with a DataWindow object returned by index value that ranges from 1 to the value of the Export.XHTML. TemplateCount property

Export.XHTML. UseTemplate

Select a template from the Use Template drop-down list box in the Data Export tab in the DataWindow painter’s Properties view.

The name of an XHTML export template (previously saved in the DataWindow painter) that optionally controls the logical structure of the XHTML generated by a DataWindow object

For detailed information about DataWindow properties, see the DataWindow Reference.