Temporarily save database queries

With the help of the GAPTEQ component “Data Source”, it is possible to temporarily save the results of database queries. This is helpful if data only needs to be read and not displayed for further use in the program sequence.

In this article you will read the following content:

Configuring the Data Source component

Initiate database query and save results

Access to stored data records

1. Configuring the Data Source component

The GAPTEQ 'Data Source' component reads data records from a table via a data layer and saves the result in the data source object. Proceed as follows:

  • First drag the Data Source component into the page. The footer of the page then shows the following:
TD_FT_PDF_DataSource_Screenshot_1
  • Define the corresponding data source (data layer) in the properties of the component. 
    You can then define the necessary filters for the query via the data layer under “Data links”.

TD_FT_PDF_DataSource_Screenshot_3

Tip! In the “Actions” of the component, events can optionally be used for program control and error handling. The following options are available:

  • loaded - Event is triggered when data has been successfully loaded.
  • loadStarted - Event is triggered when the loading of the data has been initiated.
  • loadNotFound - Event is triggered when the query does not return any data.
  • loadError - Event is triggered when the loading of the data has failed 

TD_FT_PDF_DataSource_Screenshot_4

2. Initiate database query and save results

Note! The reading of data into a data source object can be triggered by any event, e.g. by the click event of a button. 


All data source objects defined for this page are listed in the “Add action” dialog of the respective component and offer the following actions for selection:

    • loadows() - Reads all data records of the query and saves them in the data source object.
    • gotoRow(index) - Selects a data set from the data source using the transferred parameter. The index starts at 0.
    • clearRows() - Clears the memory of the data source object.
    • loadRow(key) - Loads a data set based on the transferred key.
    • findRow(key) - Loads a data set based on the passed key and clears the memory if no data set was found.

TD_FT_PDF_DataSource_Screenshot_5

3. Access to stored data records

In our example, we now access the stored values of the data source object and use them to assign the parameters of a link button.

  • To do this, select “navigation” and “open (page, parameter)” for the “clicked” event of the button and store a page that expects parameters.
  • Under the data links, the previously configured data source component (dataSource1) can now be selected under Data link and the desired value can be defined as a parameter.

TD_FT_PDF_DataSource_Screenshot_6