Spreadsheet Examples

The following examples include a spreadsheet template and a spreadsheet entity created from that template.

See Also

Spreadsheets

Template Creation Example

Although Xephr Repositories are initialized with a template for each entity type, we are going to create a new template in order to familiarize you with the process.  

Since we want all spreadsheet files created to display the database from which they were created displayed in the file, we will create a template and add a single block with a heading on it.

  1. Select the Template Information object.

  2. Right click and select Create >Template

  3. The Entity Creation Wizard is displayed.

  4. Click on the Spreadsheet bullet.

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

  6. In the Entity Name property, type SPREADSHEET_TEMPLATE as the entity name.

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

  8. Leave the Based On property set to (NONE), since this template will not be based off of any other template.

  9. Leave the Default Mode property set to Run Report.  This property determines the default mode for the reports created from this template.  

  10. In the Body Style property, select REPORT_STYLE, which was created in the Style Example section.  This property determines the default style for the spreadsheet.

  11. In the Editable Field Style property, select REPORT_STYLE, which was created in the Style Example section. .  This property determines the default style for editable fields for the spreadsheet.

  12. In the Non-Editable Field Style property, select REPORT_STYLE, which was created in the Style Example section.  This property determines the default style for non-editable fields for the spreadsheet.

  13. In the Lov Style property, select DEFAULT_STYLE, which was modified in the Style Example section.  This property determines the default style for list of values activated for the spreadsheet.

  14. In the Link Style property, select LINKS, which was created in the Link Style Example section.  This property determines the default style for links on the spreadsheet.

  15. Click on the Next button at the bottom right of the screen to continue to the block creation section of the wizard.  If you were not going to add a block to the template, you could click on Finish here instead.

  16. In the Block Name property, enter HEADER as the name of the block.

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

  18. Set the Query Type property to Not From Query, since the heading text will be hard coded.

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

  20. Leave the Create Heading checkbox set to off, since we do not need an extra field created for this spreadsheet.

  21. In the Scheme Selection section, leave the Form bullet set to on.  This block will only be displaying one record that has hard coded values, so Form is the best choice.

  22. Click on the Next button at the bottom right of the screen to add fields.

  23. Click on the Add button to add a field.  

  24. In the field, enter HEADER_TEXT and press the Enter key on the keyboard.

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

  26. Click on the Finish button at the bottom right of the screen.

  27. The template is created and displayed in green in the Explorer Tree.

  28. Click on the Save button in the main toolbar to save the new template.

  29. Click on the SPREADSHEET_TEMPLATE entity.  Verify that these settings are acceptable.  For more information on these settings, see either the Property Definitions section or the Spreadsheet Templates section.

  30. Click on the Save button in the main toolbar to save the changes.

Entity Creation Example

Now we will create a spreadsheet entity that will display the contact information for customers 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 spreadsheet entity.

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

  3. Click on the Spreadsheet bullet.

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

  5. In the Entity Name property, type CUSTOMER_SS 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 SPREADSHEET_TEMPLATE, which is the template that we created earlier.

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

  9. Leave the Body Style set to (from parent).

  10. Leave the Editable Field Style set to (from parent).

  11. Leave the Non- Editable Field Style set to (from parent).

  12. Leave the Lov Style set to (from parent).

  13. Leave the Link Style set to (from parent).

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

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

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

  17. Set the Query Type property to Simple Query.

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

  19. In the Table property, select the name of the table or view from which you are exporting the data.  Since our datasource is set to use the Oracle 9i database for NDS Applications, we will select the view CUSTMAST_UVW.

  20. Leave the Create Heading checkbox set to off as we do not need an extra label field to be added for header text.

  21. In the Scheme Selection section, set the List bullet to on.  This block will display multiple records, and the labels need to be displayed in a row at the top, while each record needs to be displayed in a row beneath that.  The list scheme will lay out the records in this fashion.

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

  23. The Adding Fields screen is displayed.  Select the columns that you wish to include in the spreadsheet.

  24. Click on the name of the column to select both the Field and Label checkboxes for that column.  Do this for the following columns:

    CUST_NAME
    CUST_NO
    CUST_URL
    FAX_PHONE
    TOLL FREE

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

  26. In the Filters property, you could enter code to restrict the data returned from the table.  We want to include all active customers for the user's current enterprise, so enter the following filters:

    where org_unit_id = $$ORG_UNIT_ID$$ and status_code = 'A'

  27. In the Ordering and Grouping property, you can enter code to determine the order in which the data is displayed in the spreadsheet file.  We want the customer's contact information to be displayed in alphabetical order by customer name, so the following should be entered:

    order by cust_name

  28. Click on the Next button to continue

  29. 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
    TOLL_FREE
    FAX_PHONE
    CUST_URL

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

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

  32. In the Explorer Tree, the new entity is added to the initially selected group.  

  33. Click on the Save button in the main toolbar to save the new spreadsheet entity.

  34. To test the new spreadsheet entity, highlight it by selecting it, and click on the Run button in the main toolbar.

  35. 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 spreadsheet is run.  Enter 100 in the value field and press the Run button.

  36. The file will be opened in your .xls file type reader.

Xephr is a registered trademark of NDS Systems, LC.

Copyright © 2007 NDS Systems LC.