Embedding a script in a report

To facilitate scripting the custom report settings UI, and also to allow "library functions" that you can use in a report, there is a new custom control type: Script.

Screen shot 2013-04-11 at 12.11.06 PMScripts controls are loaded by the report settings dialog and can get messages associated with the dialog. The script is unloaded automatically when the report finishes.

Handlers declared public are available to expressions in the report using the scriptname:handlername syntax.

By the way, there is also now a Radio control. Contiguous radio controls are automatically grouped.

You can act on changes to checkboxes, popups and radios by implementing an ExitedField handler for the control (no, you cannot ValidateField them).

Note: There is no syntax checking in this dialog. To test your script, write it in the script editor, then copy and paste in here once it is working (in which case the Before should actually be Before:F_REPSETUP)

Posted in MWScript | Comments Off on Embedding a script in a report