Additional features of report data management

Additional features of report data management

Report data is displayed on data bands (MasterData, DetailData SubdetailData components). By default, the entries appear in the print layouts of reports and software module print formats in the order defined in the query. By contrast, data in the print layouts of screen form print formats appear in the same order as in the screen form data grid.

When you create print layouts, this order is not always convenient. If you want to change the way data appear, you need to perform additional operations.

The data band allows you to carry out the following operations on the data in the set:

To perform these operations, you need to specify certain required attribute values of the data band. The list of attributes that are necessary for performing each of the operations is presented in the data grid below.

Operation name

Data band attribute name

Type of input data

Sort data

DataFileldOrder

String (list of fields separated by commas)

Filter data

DataFilter

String (expression)

Control data appearance in print layouts

VisibleCondition

String (expression)

Create tree lists

DataFieldTreeKey

DataFieldTreeParent

String (names of the key field and parent field, respectively)

Sort data

To sort data in the data band, use the FieldOrder feature. You need to indicate the names of the fields by which data will be sorted. Fields in the list are separated by commas. For each field, you can also indicate the sorting order (ascending or descending). The default sort mode is ascending.

Filter data

By filtering data you can make the print layout display only data that meet the selected requirements rather than all data from the data grid or all data returned by the query. The filter condition must meet the requirements of the Transact SQL language.

To filter data, you need to specify the filter condition in the DataFilter attribute value.

Figure 3.210. Establishing a condition for the data set data filter


To filter data from the data set, you can also use local SQL queries. In order to create a local query, you must either create a new or use an existent event handler. To create a local query, you need to use the TssFastReportDataSet component.

//Example of a local data filter query TssFastReportDataSet(MasterData1.DataSet).LocalSQL := 'SELECT FROM Main WHERE <filter condition>' 

Control visibility of data set data

Using data visibility control and filtering allows you to configure the print layout to display only the data that match the user-defined conditions. Unlike filters, data visibility control allows you to take into account the data that will not be displayed in the print layout.

In order to control what data will be visible, you must specify the visibility condition in the VisibleCondition attribute value.

Through the VisibleCondition attribute, you can connect the MasterData and DetailData data bands. For example, the MasterData data band will display attributes of stock adjustment records, while the DetailData data band will display the specification items of these records.

Figure 3.211. Establishing a condition for the visibility of data from the data set


Create tree lists

Sometimes when you create a report, data will be displayed as a tree list.

For the tree list to display correctly, you need to specify values for two attributes: DataFieldTreeKey and DataFieldTreeParent. For the DataFieldTreeKey attribute, define the key field name. For the DataFieldTreeParent attribute name, specify the parent name. For a text object, define the left margin (TreeLevelMargin attribute) and, if necessary, the text that appears before the value (TreeText attribute).

Figure 3.212. Establishing a condition for displaying a data set tree list