Action Menus
Developers can customize the Actions menu.
Here are actions available in all SaveToDB products:
- Executing queries from tables and views
- Executing stored procedures
- Executing SQL commands
- Executing HTTP commands
The SaveToDB add-in additionally supports:
- Executing macros
- Executing Windows Shell and CMD commands
- Exporting worksheets
- Creating PDF files
- Refreshing data
- Selecting, hiding, and showing worksheets
See more details at Handler Types.
To add menu items, use records with the Actions event type in the xls.handlers table.
For example:
ID | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | EVENT_NAME | HANDLER_SCHEMA | HANDLER_NAME | HANDLER_TYPE | HANDLER_CODE | TARGET_WORKSHEET | MENU_ORDER | EDIT_PARAMETERS |
---|---|---|---|---|---|---|---|---|---|---|---|
s04 | usp_order_form | Actions | s04 | xl_actions_items_print_as_html | PROCEDURE | 11 | |||||
s04 | usp_order_form | Actions | s04 | MenuSeparator40 | MENUSEPARATOR | 40 | |||||
s04 | usp_order_form | Actions | s04 | xl_actions_items_insert_item | PROCEDURE | _Reload | 41 |
This sample has two items separated by a menu separator.
Menu separators must have names, as the table has a unique index that includes columns from TABLE_SCHEMA to HANDLER_NAME.
You can use the translation features to define business names for menu items. See Translating Object Names.
Use integer values in the MENU_ORDER column to order items.
Pay attention to the _Reload value in the TARGET_WORKSHEET column.
You can use it to reload data after executing the handler. See more options at Target Worksheet Values.
Here is another sample:
ID | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | EVENT_NAME | HANDLER_SCHEMA | HANDLER_NAME | HANDLER_TYPE | HANDLER_CODE | TARGET_WORKSHEET | MENU_ORDER | EDIT_PARAMETERS |
---|---|---|---|---|---|---|---|---|---|---|---|
s05 | usp_order_header | Actions | s05 | xl_actions_order_create | PROCEDURE | _reload | 11 | 0 | |||
s05 | usp_order_header | Actions | s05 | MenuSeparator30 | MENUSEPARATOR | 30 | |||||
s05 | usp_order_header | Actions | s05 | xl_actions_order_print | PROCEDURE | 31 | 0 | ||||
s05 | usp_order_header | Actions | s05 | Create Quote & Invoice PDF | quote,invoice | 32 | |||||
s05 | usp_order_header | Actions | s05 | Create Quote & Invoice XSLX | REPORT | quote,invoice | 33 |
It also contains procedures. Pay attention to zeros in the EDIT_PARAMETERS column. You can use this to suppress the dialog box used to edit parameters.
The PDF and REPORT handlers have lists of worksheets used to generate PDF and export worksheets in the TARGET_WORKSHEET field.
See more details at Handler Types.
Context Parameters
Application menu handlers can use values of the active query parameters and the following context parameters.
Contrary to the context menu handlers, these handlers can have no active row context.
Parameter Name | Value |
---|---|
@DataLanguage or @data_language | A data language code selected using the Options dialog box |
@TableName or @table_name | A qualified name of the active query object like [s02].[usp_cashbook] |
@WindowsUserName or @windows_user_name | The Windows login of the current user |