QBE and List blocks can be combined so that they are both displayed on the same screen. This allows the user to enter query restrictions, show a list of the results, and then modify the query information without having to return to the query screen.
In addition, the columns that are included on the list block can be selected when the query is entered. For more information, see the QBE Column Selector section.
To set up a QBE/List block combination, first create your QBE block. When creating the block, make sure to select the Form scheme and include the block in both the QBE and List modes.
Then, create the List block as you would normally. Remember that in order for the search to work, your QBE and List database blocks need to be named the same. For example, if your QBE database block was named SALES_ORDERS, your List database block would also need to be named SALES_ORDERS.
On the designer layout screen, lay out the QBE block and the List block as you want them displayed.. When doing this, be aware that your list block will need room to expand. For instance, you might want to place the QBE block at the top of the screen so that the list block will be below the QBE block, and not expand so much that you cannot see the QBE block when the screen is displayed in List mode. You could also make your list block Fixed with Scroll Bars so that it will not expand but you will still be able to see all of the returned rows.
When you set up your link or button to execute the search, make sure that you include it on both the list and qbe modes.
When you run the screen, enter the query information on the qbe mode screen and press the link or button that you set up. When the list mode screen is displayed, the query information that you entered will be included in the qbe block of the list mode screen and the results that matched your search will be displayed in the list block.
You can then enter new query information in the qbe block and press the execute search link or button again to display the results.
Spreadsheets can be generated for the results generated from a QBE/List Combination block. The following rules must be followed:
A spreadsheet entity must exist, and it must have a single list block that is an exact copy of the list block on the screen entity. The easiest way to do this is to copy the entire list block and paste the copy into an empty spreadsheet entity.
Since the QBE block is basically acting as a parameter form for the spreadsheet entity, each of the fields on the QBE screen must have the Target Column property set up to point to the appropriate block.field on the spreadsheet list block.
A link or button must be created on the list mode of the screen that will generate the spreadsheet using the Xephr function ExecuteReport('SPREADSHEET_NAME'); or ExecuteReportInNewWindow('SPREADSHEET_NAME'); where SPREADSHEET_NAME is the name of the spreadsheet entity. ExecuteReport('SPREADSHEET_NAME'); will open the spreadsheet in the current window. ExecuteReportInNewWindow('SPREADSHEET_NAME'); will open the spreadsheet in a new browser window.
Open the screen in QBE mode.
Enter the query restrictions.
Press the link or button that executes the search using the ExecuteQbe(); Xephr function.
When the list screen completes loading, press the link or button that creates the spreadsheet.