Report Entity Example - List Report

Using the report template created earlier, we will create a report listing open sales orders by customer.

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

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

  3. Click on the Report bullet.

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

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

  8. Leave the Default Mode property set to Parameter Form.   

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

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

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

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

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

  14. Leave the Document Security set to Not Secure.

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

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

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

  18. Set the Query Type property to Simple Query.

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

  20. In the Table property, select the name of the table or view from which the data will be obtained.  Since our datasource is set to use the Oracle 9i database for NDS Applications, we will select the view OEHEAD_UVW.

  21. Leave the Create Heading checkbox set to off since we do not want a heading to be created for the block.

  22. In the Scheme Selection section, set the List bullet to on since we will be seeing multiple records on the block at the same time.

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

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

  25. 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
    ESTSHIP_DT
    ORDER_DATE
    ORDER_NO
    ORDER_SUFFIX
    ORG_UNIT_ID

  26. A key must be selected to continue.  Set the Key checkbox to on for the ORDER_NO, ORDER_SUFFIX, and ORG_UNIT_ID fields as they are the keys to this view.

  27. In the Filters property, you could enter code to restrict the data returned from the table.  We want to include all sales orders for the selected customer for the user's current enterprise, so enter the following filters.

    where order_status = 'O' and org_unit_id = $$ORG_UNIT_ID$$

  28. In the Ordering and Grouping property, you can enter code to determine the order in which the data is displayed in the report.  We want the report to be ordered by customer number, and then sales order number, so the following should be entered:

    order by cust_no, order_no

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

  30. 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
    ORDER_NO
    ORDER_SUFFIX
    ESTSHIP_DT
    ORDER_DATE
    ORG_UNIT_ID

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

  32. The Option to Add More screen is displayed.  We need to add one more block for the parameter form for this report.

  33. Set the Add Block or Labels flag to on.

  34. The report is displayed.  Click on the OPEN_SALES_ORDERS report to select it.

  35. Click on the Add Block button at the bottom of the screen to add the next block.

  36. The Adding New Block screen is displayed.

  37. In the Block Name field, enter PARAMETER_FORM.

  38. Set the Block Type to Parameter Form.

  39. Set the Create Heading flag to on as we want an extra field on this block for a header.

  40. In the Editable Field Style pop-list, select DEFAULT_DATA_ENTRY.

  41. In the Non-Editable Field Style pop-list, select DEFAULT_STYLE.

  42. In the Body Style pop-list, select DEFAULT_STYLE.

  43. In the Link Style pop-list, select LINKS.

  44. Click on the Next button to continue.

  45. The Adding Fields screen is displayed next.  A field is displayed here for each of the database fields that were selected on the database block.

  46. Set the Include flag to on for the SALES_ORDERS.CUST_NO field, as we want the report to be able to be restricted to a specific customer.

  47. Click on the Next button at the bottom of the screen to continue.

  48. The Ordering Fields screen is displayed Next.  Since we only have one field, there's nothing to order.

  49. Click on the Next button at the bottom of the screen to continue.

  50. The Option to Add More screen is displayed.  

  51. We have no more blocks to add, so click on the Finish button.

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

  53. Click on the Save button in the main toolbar to save the new report entity.

  54. In the Explorer Tree, left click on the OPEN_SALES_ORDERS report entity and display the property sheet.

  55. In the Title property, enter the title for this report - Open Sales Orders by Customer

  56. All other settings come from the report template.  

  57. Expand the HEADER_BLOCK block next, select the HEADER_TEXT field, and display the property sheet.

  58. In the Contents property, enter the name of the new report - Open Sales Orders by Customer.

  59. Expand the PARAMETER_FORM block next.  

  60. Select the CUST_NO field and display the property sheet.
  61. In the List of Values property, select the CUST_NO list of values that was created in the List of Values Examples section.

  62. In the Text Case property, select Uppercase as customer numbers are restricted to uppercase.

  63. In the Contents field, the global $$CUST_NO$$ is entered automatically.  This global is set on the execution of the report, and if the global exists, its value will be placed in this field the next time the report is run in the same session.

  64. Scroll down on the property sheet and in the Target Column, the block and field that will be restricted by the value entered in this field on the parameter form is displayed.  This is the block and field that was selected during the block creation.

  65. Select the HEADING field and display the property sheet.

  66. In the Contents field, enter Open Sales Orders by Customer.

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

  68. Right click on the PARAMETER_FORM block, and select Create > Label from the menu.  We need to add a button that will run the report.

  69. The Adding Labels screen is displayed.  

  70. Click on the Add button to add a field to the Fields section.

  71. In the field, enter RUN.

  72. Click on the Add Fields button at the bottom of the screen to add the field.

  73. In the Explorer Tree, select the new RUN field and display the property sheet.

  74. Set the Display As property to Button.

  75. Set the Field Style property to DEFAULT_BUTTON.

  76. In the Contents property, enter Run Report.

  77. Scroll down until you reach the On Mouse Click field.  Enter ExecuteReport();

  78. Click on the Save button in the main toolbar to save the new field.

  79. Right click on the PARAMETER_FORM block and select Designer Frame from the menu.  We need to lay out the fields on the parameter form.

  80. Initially, the parameter form looks something like this:

  81. The block needs to be made taller, the header and fields need to be moved to the middle of the block, and the button needs to be moved to below the fields.

  82. To expand the header field, click on the field that reads Open Sales Orders by C....  Hold your cursor over the right edge until it turns into a double-headed arrow.  Then, hold down the left mouse button and drag the edge out until you can see all the text.

  83. To expand the block, click on the block to select it.  Hold your cursor over the bottom edge until it turns into a double headed arrow.  Then, hold down the left mouse button and drag down the edge until you have enough room to move the Run button.

  84. Move the fields around until they look like this.  You can hold down the shift key to select multiple fields at the same time.  When fields are selected, you can use the arrow keys on the keyboard for more precise, one pixel movement.

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

  86. To test the new report entity, highlight it by selecting it in the Explorer Tree, and click on the Run button in the main toolbar.

  87. Since a global variable was defined in the Filtering property, you must define the value before the screen is run.  Enter 100 in the value field and press the Run button.

  88. The parameter screen will be run in the browser.

  89. Enter the customer number in the Cust No field and press the Run Report button.

  90. The report will be generated and displayed on the screen.

  91. Additional modifications can be made in the Designer Tool for layout and text changes using the learned functionality, such as expanding the size of the header and date fields, modifying the column labels, and assigning formats mask to the order date and estimated ship date fields.

Xephr is a registered trademark of NDS Systems, LC.

Copyright © 2007 NDS Systems LC.