XML Document Examples - XML Document

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.

  1. Select the Group Information object.  Expand it, and select the group to which you wish to add the new XML document entity.

  2. Right click on the group and select New->Wizard->Entity.

  3. Click on the XML Document bullet.

  4. Click on the Next button at the bottom right of the screen.

  5. In the Entity Name property, type CUSTOMERS as the entity name.

  6. Leave the Datasource property set to (use default), since there is only one datasource for the Xephr install.

  7. In the Based On property, select XML_TEMPLATE, which is the template that we created earlier.

  8. Leave the Default Mode property set to Run Report.   

  9. Leave the Body Style, Editable Field Style, Non- Editable Field Style, Lov Style, and Link Style properties set to (from parent).

  10. Click on the Next button at the bottom right of the screen.

  11. In the Block Name property, enter CUSTOMERS as the name of the block.

  12. In the Block Type property, select Standard Block.

  13. Set the Query Type property to Simple Query.

  14. Leave the Datasource property set to (use parent).

  15. 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.

  16. Leave the Create Heading checkbox set to off.

  17. Click on the Next button at the bottom right of the screen.

  18. 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

  19. 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.

  20. 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$$

  21. 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

  22. Click on the Next button to continue.

  23. 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

  24. Click on the Next button when you have finished moving the fields.

  1. The Option to Add More screen is displayed.  We have no more blocks to add, so click on the Finish button.

  2. The new entity is added to the initially selected group.  

  3. Click on the Save button in the main toolbar to save the new XML document entity.

  4. To test the new XML document entity, highlight it by selecting it, and click on the Run button in the main toolbar.

  5. 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.

  6. The file will be opened in the browser.

Xephr is a registered trademark of NDS Systems, LC.

Copyright © 2007 NDS Systems LC.