Help home › Special Plugin Types › Report Plugins › FH_Startup (entry-point)

Report Plugins

FH_Startup (entry-point)

Description

This entry-point is rarely needed or used.  Implement this function if you wish to replace the default startup dialog - that is, the dialog that appears each time the report is run. You must also specify "plugin" as the value for 'startup' in FH_Requirements.

If you prompt the user with options, you are strongly recommended to store the values chosen in the report options file, in a section named "Plugin" (this is where by default, plugin-specific options are stored).  If possible, your dialog should also provide some way for the user to access the default report options dialog (via a button or link or menu command, say).  This is because the default report options dialog provides numerous options relating to page layout and possibly other things, which your options dialog will not handle, but which the user will still need to be able to access. If the user clicks the relevant button or link, you should call fnShowDefaultRptOptionsDlg to display the default report options dialog.  fnShowDefaultRptOptionsDlg is FH_Startup's only parameter.  It is an unusual kind of parameter.  Most parameters are text, booleans, numbers, or some kind of object.  fnShowDefaultRptOptionsDlg is a function (or if you prefer, you can think of it as a link to a function).  More specifically, it is a function which takes one parameter and does not return anything.  The parameter it takes is a window handle.  This must be supplied.  It should be either the window handle of your own options dialog (if still visible at this point), or failing that, the 'parent window' handle returned by fhGetContextInfo("CI_PARENT_HWND").  Iup dialogs have a read-only attribute HWND which is the window handle (as a light userdata object).

Syntax

bOK = FH_Startup(fnShowDefaultRptOptsDlg)

Parameters

fnShowDefaultRptOptsDlg
A function object.  Call this function to display the default Report Options dialog.  The function takes one parameters and returns no value.  Call it like this:
fnShowRptOptsDlg()

Returns

bOK

Example

-- Add this entry-point function to your report plugin to replace the default start up dialog
function FH_Startup(strReportOptsFile, fnShowRptOptsDlg) -- add your own start up dialog here.

fnShowRptOptsDlg() -- normally you would only call this function if the user clicked to view standard report options
end