Action Menus

Action Menus

You can customize the Actions menu in SaveToDB products.

Available Actions

The following actions are available across all SaveToDB products:

  • Execute queries from tables and views
  • Execute stored procedures
  • Execute SQL commands
  • Execute HTTP commands

The SaveToDB add-in also supports:

  • Execute macros
  • Execute Windows Shell and CMD commands
  • Export worksheets
  • Create PDF files
  • Refresh data
  • Select, hide, and show worksheets

For more details, check out Handler Types.

Adding Menu Items

To add menu items, create records with the Actions event type in the xls.handlers table.

Example

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODETARGET_WORKSHEETMENU_ORDEREDIT_PARAMETERS
 s04usp_order_formActionss04xl_actions_items_print_as_htmlPROCEDURE11
 s04usp_order_formActionss04MenuSeparator40MENUSEPARATOR40
 s04usp_order_formActionss04xl_actions_items_insert_itemPROCEDURE_Reload41

This example shows two items separated by a menu separator.

Note: Menu separators must have names because the table uses a unique index that includes columns from TABLE_SCHEMA to HANDLER_NAME.

You can use translation features to define business names for menu items. See Translating Object Names.

Use integer values in the MENU_ORDER column to arrange items.

Pay attention to the _Reload value in the TARGET_WORKSHEET column. This value allows you to reload data after executing the handler. For more options, refer to Target Worksheet Values.

Another Example

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODETARGET_WORKSHEETMENU_ORDEREDIT_PARAMETERS
 s05usp_order_headerActionss05xl_actions_order_createPROCEDURE_reload110
 s05usp_order_headerActionss05MenuSeparator30MENUSEPARATOR30
 s05usp_order_headerActionss05xl_actions_order_printPROCEDURE310
 s05usp_order_headerActionss05Create Quote & Invoice PDFPDFquote,invoice32
 s05usp_order_headerActionss05Create Quote & Invoice XLSXREPORTquote,invoice33

This example also includes procedures. Note the zeros in the EDIT_PARAMETERS column, which suppress the dialog box for editing parameters.

The PDF and REPORT handlers specify lists of worksheets in the TARGET_WORKSHEET field for generating PDFs and exporting worksheets.

For more details, see Handler Types.

Context Parameters

Application menu handlers can access values of active query parameters and the following context parameters. Unlike context menu handlers, these handlers do not have an active row context.

Parameter NameValue
@DataLanguage or @data_languageA data language code selected in the Options dialog box
@TableName or @table_nameA qualified name of the active query object, e.g., [s02].[usp_cashbook]
@WindowsUserName or @windows_user_nameThe Windows login of the current user

This website is using cookies. By continuing to browse, you give us your consent to our use of cookies as explained in our Cookie Policy.