Report Entity Example - List Report with Totals

Using the report template created earlier, we will create a report listing all open invoices, with totals by customer and for the entire report.

  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_INVOICE_TOTALS 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 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. 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 INVOICES 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 ARINVSUM_VW.

  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
    CUR_BALANCE
    CUST_NO
    INVDATE
    INVNO
    INVOICE_TYPE
    INV_DUE_DATE
    ORIG_AMT

  26. A key must be selected to continue.  Set the Key checkbox to on for the INVNO field as it is the key for this view.

  27. Formatting can be applied to some of these fields.  In the Format column, select the following format masks for the following fields.
    CUR_BALANCE     #,###,###.00
    INVDATE                MM-dd-yyyy
    INV_DUE_DATE    MM-dd-yyyy
    ORIG_AMT             #,###,###.00

  28. We need to apply the breaks on some of the columns as well.  For the CUST_NO field, set the Break Type to Break on Column, this indicates that totals will be applied for each customer.

  29. For the CUR_BALANCE field, set the Break Type to Automatic Totals.  This indicates that totals will be calculated for this column.

  30. For the ORIG_AMT field, set the Break Type Automatic Totals.  This indicates that totals will be calculated for this column.

  31. In the Filters property, you could enter code to restrict the data returned from the table.  We want to include all invoices with a current balance for the user's current enterprise, so enter the following filters.

    where cur_balance <> 0 and org_unit_id = $$ORG_UNIT_ID$$

  32. 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 invoice due date, so the following should be entered:

    order by cust_no, inv_due_date

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

  34. 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
    INVNO
    INVOICE_TYPE
    INV_DATE
    INV_DUE_DATE
    ORIG_AMT
    CUR_BALANCE

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

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

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

  38. The report is displayed.  Click on the OPEN_INVOICE_TOTALS report to select it.

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

  40. The Adding New Block screen is displayed.

  41. In the Block Name field, enter PARAMETER_FORM.

  42. Set the Block Type to Parameter Form.

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

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

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

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

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

  48. Click on the Next button to continue.

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

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

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

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

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

  54. The Option to Add More screen is displayed.  We need to add a label to the parameter form in order to run the report.  

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

  56. Expand the OPEN_INVOICE_TOTAL entity.

  57. Click on the PARAMETER_FORM block to select it.

  58. Click on the Add Labels button at the bottom of the screen.

  59. The Adding Labels screen is displayed.

  60. Click on the Add button to add a field to the section on the left.

  61. In the field, enter Run.

  62. Click on Next button at the bottom of the screen.

  63. The Option to Add More screen is displayed.

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

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

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

  67. In the Explorer Tree, left click on the OPEN_INVOICE_TOTALS report entity and display the property sheet.

  68. In the Title property, enter the title for this report - Open Invoices with Totals

  69. All other settings come from the report template.  

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

  71. In the Contents property, enter the name of the new report - Open Invoices with Totals.

  72. Expand the PARAMETER_FORM block next.  

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

  74. In the Contents property, enter the name of the new report - Open Invoices with Totals.

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

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

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

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

  80. Select the RUN field and display the property sheet.

  81. Set the Display As property to Button.

  82. Set the Field Style property to DEFAULT_BUTTON.

  83. In the Contents property, enter Run Report.

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

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

  86. In the Explorer Tree, left click on the OPEN_INVOICE_TOTALS entity to select it.

  87. Right click to display the menu.  Select Designer Frame from the menu.

  88. The Designer Tool will be displayed containing the Parameter Form.  We need to modify the report itself first.  

  89. In the pop-list in the upper right of the Designer Tool, select Run Report.

  90. The report is displayed.

  91. Notice that the report title is too small to display all of the words.  Left click on the field to select it.  Then, hold your cursor over the right edge of the field until it turns into a double headed arrow.  Left click, hold down the mouse button, and drag the edge to the right until the field displays all the words.
     

  92. Select the field that displays the text In.  This is the Invoice Type label.  In the Contents field, enter Typ.

  93. Repeat these steps for the following Labels:

    Label

    Contents

    Invno

    Invoice

    Invdate

    Inv Date

    Inv Due Date

    Due Date

    Cur Balance

    Curr Bal

  94. The Designer Tool will look like this:

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

  96. Set the pop-list in the upper right corner of the Designer Tool to CUST_NO_TTL, which is the first total block created.

  97. Select the CUST_NO field in the Designer Tool, in the Total Block.  We are going to modify this field to be a label field for the total block.  Double click on the field to display the property sheet.

  98. Set the From Database property to false.

  99. In the Contents field, enter Customer Total.

  100. Change the X property to 102.

  101. Change the Width property to 100.

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

  103. In the Explorer Tree, in the CUST_NO_TTL block, right click on the CUST_NO field.

  104. Select Copy from the menu.

  105. Right click on the REPORT_TOTALS block.

  106. Select Paste from the menu.

  107. Left click on the pasted CUST_NO field.

  108. In the Contents field, change the text to Report Total.

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

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

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

  112. The parameter screen is run in the browser.

  113. Enter the customer number in the Cust No field and press the Run Report button.  If you leave the field blank, the report will include all customers.  You can double click in this field to display the list of values.

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

  115. Additional modifications can be made in the Designer Tool for layout and text changes using the learned functionality, such as spreading out all fields, and lengthening the date fields:

Xephr is a registered trademark of NDS Systems, LC.

Copyright © 2007 NDS Systems LC.