Export.XML.TemplateCount

Description

The number of XML export templates associated with a DataWindow object.

Applies to

DataWindow objects

Syntax

PowerBuilder dot notation:

dw_control.Object.DataWindow.Export.XML.TemplateCount

Describe argument:

"DataWindow.Export.XML.TemplateCount"

Usage

This property is used to get a count of the XML export templates associated with a DataWindow object. It returns a long specifying the number of XML export templates previously saved in the DataWindow painter for the specified DataWindow object. The count is used with the DataWindow.Export.XML.Template[ ].Name property to enable an application to select an export template at runtime.

Examples

This code in the open event of a window uses the TemplateCount property to get the number of templates associated with dw1. It then uses the number returned as the upper limit in a FOR loop that populates a drop-down list box with the template names, using the DataWindow.Export.XML.Template[ ].Name property.

string ls_template_count, ls_template_name
long i

ls_template_count = dw1.Describe ("DataWindow.Export.XML.TemplateCount")

for i=1 to Long(ls_template_count)
  ls_template_name = dw1.Object.DataWindow.Export.XML.Template[i].Name
  ddlb_1.AddItem(ls_template_name)
next

Before generating the XML, set the export template using the text in the drop-down list box:

dw1.Object.DataWindow.Export.XML.UseTemplate = ddlb_1.text

See also

Export.XML.Template[ ].Name

Export.XML.UseTemplate