In this example, we will create an XML document entity that will list the active customers and their address using the template we just created.
Select the Group Information object. Expand it, and select the group to which you wish to add the new XML document entity.
Right click on the group and select
New->Wizard->Entity.
Click on the XML
Document bullet.
Click on the Next button at the bottom right of the screen.
In the Entity Name property, type CUSTOMERS as the entity name.
Leave the Datasource property set to (use default), since there is only one datasource for the Xephr install.
In the Based On property, select XML_TEMPLATE, which is the template that we created earlier.
Leave the Default Mode property set to Run Report.
Leave the Body
Style, Editable Field Style, Non- Editable Field Style, Lov Style,
and Link Style properties set
to (from parent).
Click on the Next button at the bottom right of the screen.
In the Block Name property, enter CUSTOMERS as the name of the block.
In the Block Type property, select Standard Block.
Set the Query Type property to Simple Query.
Leave the Datasource property set to (use parent).
In the Table property, select the name of the table or view from which you are obtaining the data. Since our datasource is set to use the Oracle 9i database for NDS Applications, we will select the view CUSTMAST_UVW.
Leave the Create
Heading checkbox set to off.
Click on the Next button at the bottom right of the screen.
The Adding
Fields screen is displayed. Select the columns
that you wish to include in the export.
Click on the name of the column to select the Field
checkbox for that column. Do this for the following
columns:
CITY
COUNTRY
CUST_ADDR1
CUST_ADDR2
CUST_NAME
CUST_NO
STATE
ZIP_CODE
A key must be selected to continue. Set the Key checkbox to on for the CUST_NO field as it is the key to this view.
In the Filters
property, enter code to restrict the data returned from the table. We
want only active customers for the current enterprise for the user, so
enter the following in this property:
where status_code = 'A' and org_unit_id = $$ORG_UNIT_ID$$
In the Ordering and
Grouping property, you can enter code to determine the order in
which the data is displayed in the XML document file. We
want the customers in alphabetical order by customer
name, so enter the following in this property:
order by cust_name
Click on the Next button to continue.
The Ordering Fields
screen is displayed next. The columns are initially
ordered as they were listed on the previous screen. To
move a field up or down, highlight the desired field by selecting it,
and click on the Move Up or Move Down buttons on the right of the screen.
Move the fields until they are in the following
order:
CUST_NO
CUST_NAME
CUST_ADDR1
CUST_ADDR2
CITY
STATE
COUNTRY
ZIP_CODE
Click on the Next
button when you have finished moving the fields.
The Option to Add More
screen is displayed. We have no more blocks to
add, so click on the Finish button.
The new entity is added to the initially selected group.
Click on the Save button in the main toolbar to save the new XML document entity.
To test the new XML document entity, highlight it by selecting it, and click on the Run button in the main toolbar.
The Preparing to Run pop-up screen is displayed. Since
a global variable was defined in the Filtering property, you must define
the value before the document is run. Enter 100
in the value field and press the
Run button.
The file will be opened in the browser.
Xephr is a registered trademark of NDS Systems, LC.
Copyright