Creating the results page for the report

  1. Select Form > Add New Page.
    The new page is displayed. The new page is added with the same background color as the first page of the report.
  2. Select the Data tab from the Toolbox to display the Data panel.
  3. From the Data panel, select Data Source.
  4. Click in the lower right corner of the workspace to paste the Data Source control.
    The data source is displayed in the workspace.
  5. From the Property Inspector, complete the Property fields for the Data Source control:
    • Left = 565
    • Max rows = 0
    • Name = dsEmployees
    • Order by = emp_lastname
    • Source Parameter
      select emp_lastname, e.paygrp_id, paygrp_name,
      					 emp_firstname, to_char(emp_hire_date,'MM/DD/YYYY') HIRE_DATE from employee e,
      					 pay_group p where e.paygrp_id in (#request.dbPayGroups#) and p.paygrp_id =
      					 e.paygrp_id 
      Note: If you are using DB2, replace the above Source Parameter SQL code with the following since DB2 is not compatible with to_char:
      select emp_lastname, e.paygrp_id, paygrp_name,
      					 emp_firstname, char(date(emp_hire_date),USA) as HIRE_DATE from employee e,
      					 pay_group p where e.paygrp_id in (#request.dbPayGroups#) and p.paygrp_id =
      					 e.paygrp_id
    • Top = 285
    • Source Type = Query

    In the above example, the data source selects records from the EMPLOYEE table (for example, employee last name, employee first name, employee pay group ID, and employee hire date) that fit the criteria specified on the first page of the report (for example, the pay group ID that the user selects from the dbPayGroups DBLookup control). A request object is used in the above query. See Requesting Data From Controls.

    After the Data Source control values have been modified, the Property Inspector displays your new information.

  6. Select the Data tab from the Toolbox to display the Data panel.
  7. Select the Data Source control.
  8. Place your cursor in the lower right corner of the workspace and click to paste the control.
  9. From the Property Inspector, complete the Property fields for the Data Source control:
    • Left = 565
    • Max Rows = 0
    • Name = dsEmployees
    • Order By = emp_lastname
    • Source Parameter
      select emp_lastname, emp_firstname, 
      to_char(emp_hire_date, 'MM/DD/YYYY') HIRE_DATE from employee 
      Note: If you are using a DB2 database, replace the above Source Parameter SQL code with the following:
      select emp_lastname, emp_firstname, 
      char(date(emp_hire_date),USA) as HIRE_DATE from employee;
    • Top = 285
    • Source Type = Query

    In the above example, the data that the report retrieves is ordered by employee last names. The data source selects from the EMPLOYEE table, the last names and first names of employees who were hired on a specified date and orders them by last name and first name.

    Once the Data Source control values have been modified, the Property Inspector displays your new information.

  10. From the Data panel, select Data Source and click to place the second data source in the lower right corner of the workspace.
  11. From the Property Inspector, complete the following Property fields for the data source:
    Note: Complete the Source Type field before you complete the Source Parameter field.
    • Left = 565
    • Max Rows = 10
    • Name = dsDate
    • Source Parameter
      select to_char(sysdate,'Mon DD, YYYY') TODAY from dual
      Note: If you are using a DB2 database, replace the above Source Parameter SQL code with the following code because DB2 does not use the DUAL table:
      select char(current date,usa) as TODAY from LOC_QUICK_TIME 
    • Top = 24
    • Source Type = Query

    In the above example, the data source retrieves the system date in the format Month/DD/YYYY (for example, Feb. 13, 2002). Once the data source values have been modified, the Property Inspector displays your new information.

  12. Select the Report tab from the Toolbox to display the Reports panel.
  13. Select Page Header and click to paste the control at the top of the workspace.
    Note: When you paste report sections in a workspace (for example, Report Header, Page Footer, Details, etc.), the control is automatically placed below the last report section in the workspace.
  14. From the Property Inspector, complete the following Property fields for the Page Header:
    • Height = 100
    • Name = Page Header

    Once the Page Header control values have been modified, the Property Inspector displays your new information.

    Some controls have default values. Unless otherwise noted, maintain the defaults for these controls when you complete the Process Steps described in this document. For example:

    • Alignment (Left)
    • Contains HTML (the checkbox is selected)
    • Foreground (set to Black color)
    • Preserve Value (the checkbox is selected)
    • Read only (select this checkbox)
    • Tab Order (0)
    • Thickness (1)
    • Viewable by (All, Sender)
    Note: The controls' measurement properties (for example, Left, Top, Height, etc.) that are shown in these examples may differ slightly when you create the sample report.
  15. From the Report panel, select Details and click to paste the control in the workspace, just below the Page Header control.
  16. From the Property Inspector, complete the Property fields for the Details control:
    • Background = Cyan from Standard Colors
    • Datasource = dsEmployees
    • Name = Detail

    Once the control values have been modified, the Property Inspector displays your new information.

  17. From the Report panel, select Page Footer and click to paste the control in the workspace, just below the Details control.
    Keep all the defaults for the control.
  18. Select the Report tab to display the Reports panel.
  19. From the Reports panel, select Report Header and click to paste the control above the Page Header of the report.
  20. From the Property Inspector, complete the following Property fields for the Report Header control:
    • Background = Select a custom color with the following settings:
      • Red = 0
      • Green = 44
      • Blue = 99
    • Height = 62
    • Name = ReportHeader

    Once the control values have been modified, the Property Inspector displays your new information.

  21. From the Controls tab, select Label and click to paste the control inside the Report Header of the report.
  22. From the Property Inspector, complete the following Property values for the Label control:
    • Background = Unselect the Default Color checkbox and then select a custom color with the following settings:
      • Red = 0
      • Green = 44
      • Blue = 99
    • Caption = Employee Report
    • Font = 22
    • Foreground = White from Standard Colors
    • Height = 26
    • Left = 13
    • Top = 22
    • Width = 239

    Once the control values have been modified, the Property Inspector displays your new information.

  23. From the Controls tab, select Label and click to paste the control inside the Page Header of the report.
  24. From the Property Inspector, complete the following Property values for the Label:
    Note: You must complete the Datasource field before you complete the Datafield field. The Datafield field is populated with fields from the data source that you select. If you attempt to complete the Datafield first, the field appears to be empty.
    • Caption = System Date
    • Datafield = TODAY
    • Datasource = dsDate
    • Font = 12, Bold
    • Left = 528
    • Name = systemdate
    • Top = 74
    • Width = 94
    Note: Label names cannot contain spaces. If a Label control name contains spaces, you receive an error message when you attempt to save the report.

    System Date: In the above example, the Label displays today's date, which is retrieved from dsDate data source.

    Once Label control values have been modified, the Property Inspector displays your new information.

  25. From the Controls tab, select Image and click to paste the control inside the Report Header of the report.
  26. From the Property Inspector, complete the following Property values for the Image:
    • Left = 323
    • Name = Logo
    • Top = 10
    • URL = /images/newlogobuildings.gif

    Once the Image control values have been modified, the Property Inspector displays your new information.

  27. From the Controls panel, select Label and click to paste the control inside the Page Footer of the report.
  28. From the Property Inspector, complete the following Property values for the Label:
    • Caption = Page:
    • Font = 12, Bold
    • Left = 241
    • Name = PageNumber
    • Top = 151
    • Width = 45

    Once the Label control values have been modified, the Property Inspector displays your new information.

  29. Select the Report tab from the Toolbox to display the Report controls.
  30. From the Report panel, select Report Summary and click to paste the control inside the Page Footer control of the report.
  31. From the Property Inspector, complete the following Property values for the Report Summary control:
    • Expression = #report.pageNumber#
    • Font = 12, Bold
    • Left = 294
    • Name = PageNumberExpression
    • Top = 151
    • Width = 23

    Once the values for the Report Summary control have been modified, the Property Inspector displays your new information. See Report Summary expressions.

  32. Select the Controls tab to display the Controls panel.
  33. From the Controls panel, select Label and click to paste the control inside the Page Header.
  34. From the Property Inspector, complete the following Property values for the Label:
    • Caption = Last Name
    • Font = 12, Bold
    • Left = 14
    • Name = LastName
    • Top = 74

    Once the Label control values have been modified, the Property Inspector displays your new information.

  35. From the Controls tab, select Label and click to paste the control inside the Page Header of the report.
  36. From the Property Inspector, complete the following Property values for the Label:
    • Caption = First Name
    • Font = 12, Bold
    • Left = 124
    • Name = FirstName
    • Top = 74

    Once the Label control values have been modified, the Property Inspector displays your new information.

  37. From the Controls tab, select Label and click to paste the control inside the Page Header of the report.
  38. From the Property Inspector, complete the following Property values for the Label:
    • Caption = Hire Date
    • Font = 12, Bold
    • Left = 224
    • Name = HireDate
    • Top = 74

    Once the Label control values have been modified, the Property Inspector displays your new information.

  39. From the Controls panel, select Label and click to paste the control in the Details section of the workspace.
  40. From the Property Inspector, complete the following Property values for the Label:

    Note: The Datasource field is automatically populated with the data source for the Details section (for example, dsEmployees).

    • Caption = First Name
    • Datafield = EMP_FIRSTNAME
    • Font = 14
    • Left = 139
    • Name = empfirstname
    • Top = 110

    Once the Label control values have been modified, the Property Inspector displays your new information.

  41. From the Controls panel, select Label and click to paste the control in the Details section of the workspace.
  42. From the Property Inspector, complete the following Property values for the Label:
    Note: You must complete the Datasource field before you complete the Datafield field, because the Datafield field is populated with fields from the data source that you select. If you attempt to complete the Datafield first, the field appears to be empty.
    • Caption = First Name
    • Datafield = HIRE_DATE
    • Datasource = dsEmployees
    • Font = 14
    • Left = 237
    • Name = HireDateFirstName
    • Top = 110

    Once the Label control values have been modified, the Property Inspector displays your new information.

  43. From the Controls panel, select Label and click to paste the control inside the Page Header of the report.
  44. From the Property Inspector, complete the following Property fields for the Label control:
    • Caption = Pay Group
    • Font = 12, Bold
    • Left = 338
    • Name = PayGroup
    • Top = 81
  45. From the Controls panel, select Label and click to paste the control inside the Details section of the report.
  46. From the Property Inspector, complete the following Property fields for the Label control:
    Note: You must complete the Datasource field before you complete the Datafield field, because the Datafield field is populated with fields from the data source that you select. If you attempt to complete the Datafield first, the field appears to be empty.
    • Caption = Pay Group
    • Datafield = PAYGRP_NAME
    • Datasource = dsEmployees
    • Font = 14
    • Left = 335
    • Name = PayGroupsLabel
    • Top = 110
    • Width = 74
  47. Save the report.

    When you have completed the steps, the results page of the Employee Report with Criteria should look like this example: