Delivering messages between library components

A message is a carrier of information that can be sent or received between library components created from the same business view. It makes the communication between the library components more flexible. A library component can send a built-in message such as filter, sort or a user defined message. A library component can do actions such as filter, sort, setting parameters or changing properties to respond a message when it receives the message. The way to send or receive a message between library components can be defined in JReport Designer, then in JReport Server, when the library components are inserted into a dashboard using JDashboard, a library component will receive the message sent out by another library component when a specific event occurs and do corresponding action to respond to the message.

A message consists of message ID, message source, message name and message value set.

A message ID is a natural number. JReport reserves the IDs from 1 to 1000, which are used in built-in messages, so users can use IDs beyond 1000 to specify a user defined message. Message source shows the information that are used to identify the source field in a library component, including instance name and source type. A message name is the name of a message that is set by report developers.

A message value set is a set of key-value pairs that are set by the report developer. Each key-value pair has one key and one value. A key or a value can be static or dynamic. A key is of string type, and each value has its own data type, which can be Number, Integer, String, Date, Time, Date Time, Boolean or Currency.

The following describes how to send or receive a message.