Visioneo reportlet can exchange informations with other portlets on the same page. It is particularly useful if you want to make use of your own report parameters widgets. Have a look at the storelet demo to see how reports can interact with other components. Possible actions are:
- Send new parameters values to a reportlet. As you will see in this article it is pretty easy to design a custom parameter portlet, such the one implemented in the professional edition.
- Send which report to display to a reportlet (allows to implement your own report browser),
- Receive informations from the reportlet (current displayed report and its parameter values)
We can find many tutorials on the web showing how to develop a simple portlet. Unless you need a cross-portal one, the best option is to refer to the targetted portal documentation. By developing a component specifically for a portal, we can take advantage of portal resources such user interface features, and get a more valuable help from portal forums. Although it is based on a standard, developing a cross-portal portlet might be much more challenging.
Every major IDE such Eclipse & Netbeans have plugins to speed up your portlet creation. If you already have a knowledge of Java, you should quickly be able to deploy a "Hello World" portlet, and little by little adding your parameters widgets in your "view mode" such datepickers, combobox static or based on a database, etc. To implement these widgets, we have various choices:
- Using a java framework such GWT.
Once your parameters widgets are ready in a custom portlet, we have to send selected values to reportlet windows and trigger a report refresh.
In the JSR 286 standard, there are 2 ways to exchange informations between portlets:
- Public shared parameters
- Portlets events
Visioneo reportlet makes use of events. If you plan to implement your own parameters portlet , first if it is not yet done you need to understand a concrete example implementing these portlet events. To achieve that, this is a very good start.
Shortly, here are the main steps:
- declare an event in your portlet descriptor,
- Send a portlet action when a user has selected new values. For example in a JSP page, use the portlet action tag in a form submit.
In your portlet action handler ("processAction" method):
- Build a query string (your parameters values with a '&' separator)
- Trigger an event with this query string
That's all! Not so easy, but not that much difficult neither! An example of the processAction method is provided later in this article.
Your portlet must declare the events qualified name in its portlet.xml file:
- Sending an event to the reportlet:
- Receiving an event from the reportlet:
- Declare in your portlet.xml, in the portlet section:
When an action is triggered from a portlet JSP page, your portal will automatically look for a "processAction" method in your portlet and invoke it. With the qualified name defined above, here is a sample java code which allows to send an event to the reportlet window(s):
- Sending the report parameters only:
In this example, 3 parameters are sent to the reportlet(s) windows present on your page. The 'products' parameters is multi-value. Each reportlet window receiving this event is able to detect which parameters are consistent. For example, if the report set up in a reportlet window does not contain 'office' parameter, it ignores it and only applys 'year' and 'products'. These new parameters are then persistent for further requests, exactly like if they were selected with toolbar parameters dialog.
- Sending the report only:
The engine will look for the
file in your reports hierarchy, and display it in the reportlet window with default report parameters. The new report is then persistent for further requests, exactly like if it was selected with the toolbar ajax report browser. Not you don't have to specify in which subfolder this report is, the reportlet engine will take care of this for you.
__reportparameter through an event only makes sense if there is only one reportlet window on your page.
- Sending both parameters and report:
The engine will look for the
file in your reports hierarchy, and display it in your reportlet window with query parameters received. This new report and its parameters are then persistent for further requests
With the qualified name defined above, you can process the event sent by the reportlet:
These kind of events can be triggered with the toolbar extended feature. See the jsp page
for a concrete example.
11 April 2016
08 February 2016
06 November 2015
28 October 2015
14 October 2015
08 October 2015
10 September 2015
07 April 2015
01 April 2015
01 April 2015