The Use Template property

The names of all templates that you create and save for the current DataWindow object display in the Use Template drop-down list.

The sample displays the Data Export page in the Properties view. XML is selected from the Format to configure drop down list. From the Use Template drop down list, template 1 has been selected. Next, a check box labeled Iterate Header for Groups is checked. Below that, an Include White space check box is cleared. XML None ! is selected from the Meta Data Type drop down list, and Meta Data Internal ! is selected from the Save Meta Data drop down list.

The template you select from the list is used to conform the XML generated by any of the methods of saving as XML to the specifications defined in the named template. Selecting a template from the list box sets the DataWindow object’s Export.XML.UseTemplate property. You can also modify the value of the UseTemplate property dynamically in a script. For example, an XML publishing engine would change templates dynamically to create different presentations of the same data.

When you open a DataWindow, the Export/Import Template view displays the template specified in the DataWindow’s Use Template property. (If the view is not visible in the current layout, select View>Export/Import Template>XML from the menu bar.) If the property has not been set, the first saved template displays or, if there are no saved templates, the default structured template displays as a basis for editing.

Template used when saving

When the DataWindow is saved as XML, PowerBuilder uses the template specified in the Use Template property. If the property has not been set, PowerBuilder uses the default template.

When you are working on a template, you might want to see the result of your changes. The template specified in the Use Template property might not be the template currently displayed in the Export/Import Template view, so you should check the value of the Use template property to be sure you get the results you expect.

StepsTo save to XML using the current template:

  1. Right-click in the Export/Import template view and select Save or Save As from the pop-up menu to save the current template.

  2. On the Data Export page in the properties view, select the current template from the Use Template drop-down list.

  3. Select File>Save Rows As, select XML from the Files of Type drop-down list, enter a file name, and click Save.