Data Field

The Data Field is used for dynamic binding of data into a report at runtime. The Data Field can be selected directly from the tool bar and placed in the report layout. Select the Properties option from the Data Field's popup menu.

The different Field types are Field, Operation, Script, URL and Literal.

Field

By default the Field type is a datasource Field. The DataSource is selected from the list of data sources in the combo box. Alternatively, by clicking the Add button on the right of the combo box you can select a data source from the Configure DataSource Wizard. On clicking the Finish button in the Configure DataSource Wizard the selected data source will be added to the list of data sources in the DataSource combo box.

The data source field name and the corresponding data types are listed in a table in the Field tab. Select the required field from the list of DataSource fields. The name of the field that has been selected is displayed in the Expression text box.

Operation

The Operation field type is selected from the combo box. The DataSource is selected from the list of data sources in the combo box. The required field is selected from the list of fields in the table.

The Average, Comma Separated List, Comma Separated Set, Count, First, Last, Maximum, Median, Minimum, Percent, Percent100, PercentCount, PercentCount100, StandardDeviation, Sum, Variance, Year to Date and Month to Date functions are listed in the combo box from which you can selected the required function type. The definitions of all the available operations is given in the Repertoire manual, "Function Reference" chapter.

The Over Group or Over All option is selected depending on whether you want to perform the function calculation over a particular group or on the whole set of data. The combination of Over Group/Over All and Running Value determines the range of records that the operation will apply to. The start of the range is controlled by Over Group and Over All. If Over All is chosen, then the range begins with the very first record of the datasource. If Over Group is chosen, then the range begins with the first record of the current group. Where there are multiple levels of grouping, the current innermost group is used.

If Running value is not selected, then the end of the range is based on the Over All/Over Group value. Over All means the last record of the datasource. Over Group means the last record of the current group. When Running Sum is enabled then the current record is used as the end of the range.

You can calculate running values that accumulate within each group and are reset each time a new group of records begins. You can also calculate running values that accumulate throughout the report. For doing this select Sum function from the combo box, select the Over All/Over Group option and finally select the Running value check box. Similarly the running value for average, maximum, minimum, etc can be calculated.

Figure 4.5. Sample Data

Sample Data

To illustrate the use of summation and running values, here's a simple example. We start with the data in Figure 4.5, “Sample Data”. We will group it by Name and perform operations on the Value. A report is designed, as shown in Figure 4.6, “Sample Running Sum Report”. The report demonstrates the use of running values and over all/over group.

Figure 4.6. Sample Running Sum Report

Sample Running Sum Report

When the report is rendered, the output appears as shown in Figure 4.7, “Running Sum Output”. Note that in the first group footer, you can still get Sum Over All, even though all records have not yet been processed. Indeed, you can put this value in the header, before any records have been processed. In the 'B' group, Running Value Over Group is reset to 0, whereas Running Group Over All continues from the value 10.0 that was built by group 'A'.

Figure 4.7. Running Sum Output

Running Sum Output

Script

The Script field type is selected from the combo box. Enter the JavaScript function in the text field.

URL

Select URL as field type from the combo box. Enter the URL in the text box. Select the URL type from the combo box.

The Font and Scripts tabs are as explained previously.

On selecting the Currency, Percent, Number or Date/Time options from the combo box various fields such as Integer Places, Fractional Places, etc appears.

The Min and Max values for the Integer Places are specified in the fields. Similarly, the Min and Max values for the Fractional places are specified in the corresponding fields.

The Show Grouping Separator has to be selected if required and the Grouping Size has to be entered in the field. For example, if Grouping Separator is selected for the number 1234567 and the Grouping size is entered as 3 it might be formatted as "1,234,567".

The Always Show Decimal Separator check box is selected if required. It affects formatting, only if there might be no digits after the decimal point, such as with a pattern like "#,##0.##", e.g., if the check box is selected then the 3456.00 -> "3456." if deselected, 3456.00 -> "3456".

The Custom Pattern check box is selected if you want to specify your own custom Pattern. After selecting the Custom Pattern check box enter the required pattern in the text box.

When the Date/Time option is selected in the Format Type combo box the Date Format and Time Format combo boxes containing various values appears. The values in the Date and Time Format combo boxes are Short, Medium, Long and Full.

If for instance there is a timestamp field having value Fri Oct 05 12 GMT+8:00 1990 then it can be formatted as Short, Long, Medium and Full by selecting the appropriate type in both the Date and Time Format combo boxes.

Short: Short is completely numeric means it displays Date/Time in Numeric format. When this option is selected the output is 10/05/90 12:00 AM

Long: Long gives a longer value. The output value is October 5, 1990 12:00 AM GMT+8:00.

Medium: This gives limited information about the Date/Time Field. When Medium is selected in the Date Format and Time Format combo boxes the output is Oct 5, 1990 12:00:00 AM.

Full: Full is pretty completely specified i.e. it gives the complete detail. The output value is Friday, October 5, 1990 12:00:00 AM GMT+8:00.

If you want to display the date and time field according to your requirements then select the Custom Pattern check box and enter the desired pattern in the text box.

After entering the Format values a sample showing how the number will be formatted based on the settings will be displayed in the Sample text box. Note the format may be dependent on the Locale

Locale: A Locale property represents a specific geographical, political, or cultural region. An operation that requires a Locale to perform its task is called locale-sensitive and uses the Locale to tailor information for the user. For example, displaying a number is a locale-sensitive operation - the number should be formatted according to the customs/conventions of the user's native country, region, or culture. The desired Locale based on which the formatting has to be done is selected from the property sheet combo box.

Hide Duplicates: When this check box is selected all the duplicate Field values are hidden. For example, if customer_id = 3 gets repeated for more than 1 record then only one field containing customer_id = 3 is displayed and then the record containing a different value is displayed.

Note

Internally, labels and fields are represented by the same component. A label is just a field with a literal data value. No formatting or hide duplicates is applied to literal values. Two icons are shown on the component toolbar to make it easy to select the kind of field that you want, but you can easily change between them.