Receiving messages

The data components, which refers to tables, charts, crosstabs and geographic maps, in a library component can receive messages, including the built-in messages 0001 - Filter, 0002 - Sort, 0003 - Parameter, and user defined messages that are sent out by itself or another library component. You can then specify actions such as filtering, sorting, running library component with predefined parameter values and changing object properties on the data component to respond the received messages.

To make a data component receive messages and respond corresponding web actions, take the following steps:

  1. Select the data component in a library component, right-click and select Receive Message from the shortcut menu. The Receive Message dialog appears. See the dialog.
  2. Click to add a message line.
  3. Select the message you want the data component to receive from the Message ID column.
  4. If a built-in message is selected, the action the message will respond cannot be changed, but you can edit how the action will be performed as you want.

    If a user define message is selected, you can specify the action the data component will respond when it receives the message and define how the action will be performed.

  5. Repeat the above steps to add more messages to receive and define the actions to respond the messages. To delete a message, select it and click .
  6. For message of the same ID and name, you can make the data component receive it more than once, and in which order the actions defined in the message will be executed is determined by the order of the messages in the list. To adjust the order, select the message and click or , then for message with the same ID and name, the higher a message is placed in the list, the earlier the action defined in it will be executed.
  7. Upon finish, click OK to close the dialog.

To receive the built-in message 0001 - Filter:

  1. In the Receive Message dialog, select the built-in message 0001 - Filter from the drop-down list of the Message ID column. The filter condition defined in the message will be automatically applied.
  2. If you want to edit the filter condition, click in the Actions column and click that appears in the text box. The Filter dialog appears. See the dialog.
  3. Specify the filter condition by selecting the field on which the filter will be based from the Filter On drop-down list, the operator to compose the condition from the Operator drop-down list and the value of how to filter the field from the Value drop-down list.
  4. If necessary, specify And or Or in the More column so as to add a new filter condition or you can click to add a new filter condition.

    To delete a filter condition, select the condition and click . To adjust the order of the filter conditions, click or .

  5. Click OK to finish defining the filter conditions.

To receive the built-in message 0002 - Sort:

  1. In the Receive Message dialog, select the built-in message 0002 - Sort from the drop-down list of the Message ID column. The sort conditions defined in the message will be automatically applied.
  2. If you want to edit the sort condition, click in the Actions column and click that appears in the text box. The Sort dialog appears. See the dialog.
  3. Specify the sort condition by selecting the field on which to sort the records from the Sort On drop-down list, and in which order to sort the records from the Sort Value drop-down list.
  4. If necessary, click to add a new sort condition.

    To delete a sort condition, select the condition and click . To adjust the order of the sort conditions, click or .

  5. Click OK to finish defining the sort conditions.

To receive the built-in message 0003 - Parameter:

  1. In the Receive Message dialog, select the built-in message 0003 - Parameter from the drop-down list of the Message ID column.
  2. Choose a message type from the Message Info column: Automatic or Customized.

To receive a user defined message and respond the Filter web action:

  1. In the Receive Message 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.
  2. In the Web Action List dialog, select *Filter in the Action Name column and click OK.
  3. In the Filter dialog, specify the filter condition as required.
  4. Click OK to accept the settings.

To receive a user defined message and respond the Sort web action:

  1. In the Receive Message 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.
  2. In the Web Action List dialog, select *Sort in the Action Name column and click OK.
  3. In the Sort dialog, specify the sort condition as required.
  4. Click OK to accept the settings.

To receive a user defined message and respond the Property web action:

  1. In the Receive Message 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.
  2. In the Web Action List dialog, select *Property in the Action Name column and click OK. The Change Property dialog appears. See the dialog.
  3. 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.

  4. 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 .

  5. Click OK to accept the settings.

To receive a user defined message and respond the Parameter web action:

  1. In the Receive Message 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.
  2. In the Web Action List dialog, select *Parameter in the Action Name column and click OK. The Parameter dialog appears. See the dialog.
  3. 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.
  4. Specifies whether to apply the action to run another library component or refresh the current. If you choose to run another 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.
  5. 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.

  6. To delete a parameter line, select it and click . To adjust the order of the parameters, click or .
  7. Click OK to accept the settings.

Note: In the drop-down lists for editing the conditions to respond a message, you may find that 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 a condition, instead, it will be mapped to a key in the message and JReport will find the value that is specified to the key from the message first and then use that value to compose the condition.