Jasper Report DashBoarding for WebSynergy

Why DashBoarding on WebSynergy?


(update October 23rd 2008 with codelet)

For a SWIFT Demonstrator I am working on, I am thinking about DashBoarding KPI data. In the meanwhile, I have been exposed to OpenESB IEP (Intelligent Event Processor) and started to create some DashBoards with Jasper Report to expose somehow the results from the IEP module. Of course, JasperReport can be used outside of the scope of IEP. JasperReport is very DataBase centric. If you got some DataBase tables available you are a good candidate to create a JasperReport.


For further information about JasperReport Design, JasperReport integration in a WebAPP and JasperReport PDF generation, have a look to : 



  • http://wikis.sun.com/display/JavaCAPS/2008/10/07/workshop_lab_IEP_JasperReport-part1

  • http://wikis.sun.com/display/JavaCAPS/workshop_lab_IEP_JasperReport-part2

  • http://wikis.sun.com/display/JavaCAPS/workshop_lab_JasperReport_PDF_Generation


These DashBoards can be easily integrated into a WebApp deployed in the OpenESB appserver. By the way, I am not convinced at all a WebApp is an ideal way to deploy a DashBoard. Most probably a portal is a more convenient place to expose a DashBoard according to your role.


So I take a look in this direction. The following screenshot is a description of a 1st prototype developed to integrate a Jasper Report into WebSynergy. 


JasperReport DashBoard in WebSynergy


JasperReport on WebSynergy


How integrating JasperReport on WebSynergy ?


In this prototype, I don't show up how to generate the JasperReport in HTML format. I have imported into my Portlet project the results of this JasperReport HTML generation : a HTML file useless  {reportname}.html and an associated directory with the images of the JasperReport {reportname}.html_files/img_0_0_0.gif and {reportname}.html_files/px.gif. The image img_0_0_0.gif contains the JasperReport I want to display in the portlet. This mechanism is out of the scope of the focus of this bog.

Following is the content of the HelloWorld_view.jsp






<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="javax.portlet.\*"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<portlet:defineObjects />
<title></title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <style type="text/css">
    a {text-decoration: none}
  </style>

<%
PortletPreferences prefs = renderRequest.getPreferences();
String imageURL =(String)renderRequest.getAttribute( "CHART_PORTLET_IMAGE_URL" );
System.out.println("### DEBUG :: imageURL : " + imageURL);
%>
<img src="<%=imageURL %>" width="450" height="243" alt="Image1"/>


 Here is the doView() method of the portlet HelloWolrd.java


 








     public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
        // set the content type to text/html
        response.setContentType( "text/html" );   
        String relativeImagePath = "/img_0_0_0.gif";

        // Set the URL of the generated image as a portlet request attribute and
        // forward the request to the index.jsp file that displays the image.
       request.setAttribute("CHART_PORTLET_IMAGE_URL", request.getContextPath() + relativeImagePath);       
       PortletRequestDispatcher dispatcher =
                getPortletContext().getRequestDispatcher( "/WEB-INF/jsp/HelloWorld_view.jsp" );
        dispatcher.include(request, response);
    }

Acknowledgment


Thanks to  Santh Chetan Chadalavada and Muralikrishna Reddy who provided me a very strong support very late in the night during a couple of days.


To learn more / blogs of reference


If you want to get more detail information about WebSynergy, DashBoard  feel free to visit the following blogs :



    Comments:

    Post a Comment:
    • HTML Syntax: NOT allowed
    About

    This blog is about Software How-to & Best Practices

    Search

    Archives
    « April 2014
    SunMonTueWedThuFriSat
      
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
       
           
    Today