Helpful Hints for working with controls

  • You can use controls as placeholders to expand the width of a report.
  • If you select multiple fields in the Group By property for the Group Header control, the report groups data that matches the combination of the selected fields. For example, if you select EMP_LASTNAME and EMP_START_DATE, the report groups only display employees who share the same last name and the same start date.
  • Use the Order By field in the Data Source definition to determine the order of the data source values that the report returns. By default, the values are sorted by ID number but you can change the sort order to display results by Name, in alphabetical order.
  • The data source specified for a Details section applies to all controls within that section. You cannot link a Label control in that Details section to a different data source.
  • You cannot link data sources between pages. To use the same data source on page 2 that you used on page 1, you must copy the data source to page 2.

Working with Report Summary controls

If you use a #count#, #average#, #value#, or #sum# expression:

  • You must specify a data source and a data field for the Report Summary. This information enables the system to determine which values should be calculated in the report.
  • You must apply the Report Summary to a group section (for example, place the Report Summary in a Group Footer control). If you do not place the Report Summary in a Group Footer, the summary is not displayed when the report is rendered.
  • To use a Report Summary to display text, specify the text in the Expression field. You do not need to use a data source with the control.
  • To summarize a group of values in the report - rather than all the values - using a Report Summary control, make sure that you group the data fields from the Group By field of the Group Header control.
  • If you use a #value# or #sum# expression (#value# and #sum# produce the same results):
    • with an ID data field (for example, EMP_ID), the report sums the total of the ID values that are returned.
    • with a date or string data field, (for example, DEPARTMENT_START_DATE, DEPARTMENT_NAME), the report only displays the last item in the group section.

If you use a #report.pageNumber# expression, you can place the Report Summary control anywhere in the report (for example, you can use the expression with any report section).

Report Summary expressions

You can add any of the following expressions to a report. You can add the first four expressions described below (for example, #value#, #sum#, #average#, and #count#) to a Report Summary control, while you can add #report.pageNumber# to a Label control.

  • #value# or #sum#

    Counts the value of line items that appear in the report section in which the Report Summary control is placed. For example, if a Report Summary control is placed in the Page Footer of a report that displays the following time codes for an employee:

    Time Code Number of occurrences
    SICK 2
    LATE 3
    WRK 6

    … the #value# or #sum# expression sums the line items as follows, at the bottom of each report page:

    2 + 3 + 6 = 11

  • #average#

    Averages the line items that appear in the report section in which the Report Summary control is placed. Using the above example, an Average expression sums the line items as follows, at the bottom of each report page:

    2 + 3 + 6

    3

    = 3.6

  • #count#

    Counts the number of line items that appear in the report section in which the Report Summary is placed. Using the example above, a Count expression sums the line items as follows, at the bottom of each report page:

    2 + 3 + 6 = 3 (for example, 3 items)

  • #report.pageNumber#

    This report summary expression is typically used with a Page Header or Page Footer control. The expression counts the number of pages in the report and displays a page number in the Page Header or Page Footer.

Notes

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