V2 Menu application logic

When an Explorer node is selected by the user, the system uses the Explorer group definitions from the related group section in the menu file to perform the following steps.

First Time selection:

  • Reportn Program Settings - CCLAS_EXPLORER are put into an array, making the Crystal Report templates available for selection by the user.
  • A SQL Select statement is constructed from the BrowserView Program Settings - CCLAS_EXPLORER.
  • A SQL Select statement is constructed from the ListViewColumnn Program Settings - CCLAS_EXPLORER. If these are absent, then the SQL Select statement is Select * from.
  • PVExplorer header definitions, width and format are determined from the ListViewColumnn Program Settings - CCLAS_EXPLORER. If these settings are absent, then the table or view field names are used as the column headers, with a default width for each column and a string format. The column headers are set in the PVExplorer object.
  • The Checked and MultiSelect Program Settings - CCLAS_EXPLORER are loaded for the system to drive the interface.
  • If a ScreenFile Program Settings - CCLAS_EXPLORER is defined and the file exists, then:
    • The form is constructed and the Form_Load procedure called, followed by AfterNodeSelectionChange procedure (if these are present).
    • If a SQLWhere procedure exists, then it is called to construct additional SQL statements required in the Select statement.
    • If a SQLOrder procedure exists, then it is called to construct additional SQL Order By statements required in the Select statement.
  • The constructed SQL statement is executed and a record set is established.
  • If a ScreenFile Program Settings - CCLAS_EXPLORER is defined and the file exists, then:
    • If an AfterDataQuery procedure exists, then it is called, typically to construct a collection of Icons used against each record in the ListView.
  • The PVExplorer items are populated with the content of the record set, with each field formatted as per the ListViewColumnn Program Settings - CCLAS_EXPLORER, and the IconIndexCollection.

Subsequent selection:

On detection of the defined cmdQuery_Click Event:

  • If the ScreenFile Program Settings - CCLAS_EXPLORER is defined and the file exists, then:
    • If a SQLWhere procedure exists, then it is called to construct additional SQL statements required in the Select statement.
    • If a SQLOrder procedure exists, then it is called to construct additional SQL Order By statements required in the Select statement.
  • The constructed SQL Statement is executed and a record set is established.
  • If an AfterDataQuery procedure exists, then it is called.
  • The PVExplorer items are populated with the content of the record set, with each field formatted as per the ListViewColumnn Program Settings - CCLAS_EXPLORER.