A form is processed and submitted to the server whenever a “submit” action occurs on the form (e.g., 'Submit' button is pressed or an 'onSubmit' script returns “true”). The submission contains a single repletRequest object that includes all form values.
To process the form on the server end, add script to the onClick Handler handler of the Form elements. To do this, open the Form in Report Designer, and follow the steps below:
Note: This is the server-side 'onClick' handler, not the client-side 'onClick' handler described in Creating a Form. You can also edit the server-side 'onClick' handler from the tabbed panel at the bottom of Report Designer window. You can add 'onClick' script to any Form element. (If you add 'onClick' scripts to multiple elements, all of these scripts are executed when the form is submitted, and all have access to the same set of form values.)
The server-side 'onClick' script has access to a RepletRequest Object containing all form element values. You can access a particular field value by using the element 'Field Name' as index:
request['FieldName'] or request.FieldName
Field names must be unique within a form (with the exception of Radio Buttons). If there are multiple “submitting” form elements, use 'request.__eventSource__' to obtain the field name of the element that triggered the submit action. For example:
if(request.__eventSource__ == 'Choice1') { ... } else if(request.__eventSource__ == 'Button1') { ... } else { ... }
Note: If the 'onClick' script of a form element on a Parameter Sheet calls the sendRequest() function, the submission from sendRequest() is sent in place of the normal form submission request. If your script modifies element values and needs to refresh the screen, it should call the reprint() or refresh() function. The 'reprint' action causes the report pages to be regenerated without refreshing the data binding. The 'refresh' action forces the report data to be refreshed before the report is reprinted. If the onClick Handler does not change the data or the way the data is bound to report elements, the reprint action is sufficient.
Style Intelligence offers advanced scripting capabilities that support dynamic report modification without requiring programming. Scripts can be applied to the whole report or to specific elements. Scripts can modify element properties, change data, pass parameters to reports, and more.
Copyright © 2024, InetSoft Technology Corp.