Receiving a user defined message
Besides the built-in messages, a data component (table, chart, crosstab or geographic map) in a library component can also receive user defined messages and then respond web actions, such as Filter, Sort, Property and Parameter.
The Filter web action enables you to filter the records of the data component when it receives the message.
The Sort web action enables you to sort the records of the data component when it receives the message.
The Property web action enables you to change properties of the data component itself when it receives the message.
The Parameter web action enables you to run a library component, especially a library component with parameters using predefined parameter values, or re-run the library component with predefined parameter values when the message is received.
This document shows how to make a data component receive a user defined message and respond different action in detail.
To receive a user defined message and respond the Filter web action:
- Select a data component in a library component, right-click and select Receive Message from the shortcut menu to display the Receive Message dialog. See the dialog.
- Input the ID and name of the user defined message in the Message ID column and Message Name column separately, then click in the Actions column and click that appears in the text box.
- In the Web Action List dialog, select *Filter in the Action Name column and click OK.
- In the Filter dialog, specify the filter condition. For details, see Receiving the built-in message 0001 - Filter.
- Click OK to accept the settings.
To receive a user defined message and respond the Sort web action:
- Repeat steps 1 and 2 in the above procedure.
- In the Web Action List dialog, select *Sort in the Action Name column and click OK.
- In the Sort dialog, specify the sort condition. For details, see Receiving the built- in message 0002 - Sort.
- Click OK to accept the settings.
To receive a user defined message and respond the Property web action:
- Repeat steps 1 and 2 in the above procedure.
- In the Web Action List dialog, select *Property in the Action Name column and click OK. The Change Property dialog appears. See the dialog.
- Specify the property you want to change and the value for it respectively from the Properties and Value drop-down lists. Only the properties of the data component itself can be changed at runtime.
In the two drop-down lists, you may find some items have the icon ahead of them and they are listed under the Message Key node. If you choose an item of this type, it means the item will not be used directly in the property changing condition, instead, it will be mapped to a key in the message and JReport will search for the value that is specified to the key from the message first and then use that value to compose the property changing condition.
- If necessary, click to add a new line to change another property.
To delete a property line, select it and click . To adjust the order of the properties, click or .
- Click OK to accept the settings.
To receive a user defined message and respond the Parameter web action:
- Repeat steps 1 and 2 in the above procedure.
- In the Web Action List dialog, select *Parameter in the Action Name column and click OK. The Parameter dialog appears. See the dialog.
- Specify the handler which will receive the parameters of the web action. The handler may be the default one in the current server, or in another server specified by Customized Path.
- Specifies whether to apply the action to run a library component or refresh the current. If you choose to run a library component, click the Browse button to specify the library component, then select the window or frame in which the library component will be opened from the Target Frame drop-down list.
- If the specified library component contains parameters, the parameters will be automatically listed in the parameters box. Specify the value for each parameter. You can also click to add a parameter line and specify the parameter and value if needed.
In the Parameter Name and Value drop-down list, you may find some items have the icon ahead of them and they are listed under the Message Key node. If you choose an item of this type, it means the item will not be used directly in the parameter condition, instead, it will be mapped to a key in the message and JReport will search for the value that is specified to the key from the message first and then use that value to compose the parameter condition.
- To delete a parameter line, select it and click . To adjust the order of the parameters, click or .
- Click OK to accept the settings.
See also Filter dialog, Sort dialog, Parameter dialog, Change Property dialog for additional information about options in the dialog.