Pre-Query Process

Pre-Query Processes allow you to perform certain instructions before running the report query.  

    1. GET-LIST: enter the list name to "get".  The query will run from the active list returned by GET-LIST.
    2. SELECT: enter a SELECT statement to run before the query.  The query will run from the active list returned by the SELECT.
    3. SSELECT: Same as SELECT but with SORT
    4. Execute a TCL Command: enter a TCL command to run.  This can be a cataloged BASIC program or any valid TCL commands that do not require user prompts.  If the command creates an active list it will be used by the query.
    5. Shell to TCL and executes the commands and or run a cataloged BASIC program.  This option suspends the GUI application before running the commands.  Commands can have any number/type of user prompts.  The GUI application is resumed once the commands are completed.
    6. Post a GUI event: Trigger an AccuTerm GUI event to open a custom GUI form.  The form must be an AccuTerm subroutine form.  

               Syntax: GUIAPP, GUIFRM, GUICTL, GUI Event, Apps file name

               Example: CompanySelect, FORM1,,Activate, DEMOAPPS

               The demo program is in DEMOBP CompanySelect, CompanySelect.Util and DEMOAPPS CompanySelect


Note: By default, phiReport expects the Pre-Query Process to return an active list.  If no active list is return phiReport considers that there is no data to report against.  To ignore this behavior enter the keyword "STOP" on the last line of the Pre-Query Process text area.  This will tell phiReprot to proceed with the report even if there's no active list.  This is useful when using the Data Blob feature or phiForm.



Post-Query Process

Post-Query Processes allow you to perform certain instructions after the query is run.

    1. DELETE-LIST: Delete a saved list
    2. SAVE-LIST: Save the active select list
    3. Execute a TCL Command: enter a TCL command to run.  This can be a catalog BASIC program or any valid TCL command.


Note 1: Pre and Post Query Processes support the %%@Totken%% notation to prompt the user to provide a value for the command.  For example, if your command requires user input, you would enter it as follows:

SELECT CUSTOMER WITH NAME = "%%@Customer Name%%"

At runtime, the user will be prompted to provide the value for "Customer Name"

See PRE and POST Operands for detail


PRQUERY will prompt for the token as part of the criteria list with the word "PRE" in column 1.  The Operator selection has no effect in this case because it is defined in the Pre-Query Process.




Note 2: You may enter 1 or more command to be executed one after another in sequence.  Each command must start a new line in the entry field.


Note 3: If the Pre-Query Process returns an error or no items, the report will not be created.