Implementation of the UI for the Drill Across using JSP Tags

The following example describes how to implement the iframe to run the drill across report so the second report opens in the same window.

 

Note:


    Create a new folder under INFOHOME/jsp to store all the jsp pages and save them under folder INFOHOME/jsp/DrillAcross for convenience and maintenance.


The JSP file View.jsp contains the following code.

<script language="JavaScript">

   function setFrameHeight() {

      var height = document.FrameForm.TextBox.value;

      _reload(sCurrentPageId, 'FrameHeight', height);

   }

</script>

<%

   String sFrameHeight = (String)request.getParameter("FrameHeight");

   if(sFrameHeight == null || sFrameHeight.equals("")) {

      sFrameHeight = "250"; This part of the code defines the height

   }

%>

<center>

<iframe name="top"

            src="/infospc/jsp/celerity/DrillAcross/frameView.jsp"

            width=100%

            height=<%= sFrameHeight %>

            marginwidth=0

            marginheight=0

            hspace=0

            vspace=0

            frameborder=0

            scrolling=YES>

</iframe> The iframe tag is used to define the dimensions of the report when it is loaded. FrameView.jsp is loaded when the report is loaded first. This is initial page only

</center>

<!--<HR noshade size="3">

<form name="FrameForm">

   <b>Frame Height:</b>

   <input type="text" size="3" name="TextBox" value="<%= sFrameHeight %>">

   <input type="button" name="Button" value="Set" onclick="javascript:setFrameHeight()">

</form>-->

The JSP file frameView.jsp contains the following code:

<html>

<head>

<title>Frame View</title>

</head>

<body>

<center>

<div align="center">

<table border="1" width="592" height="216">

<tr>

<td width="592" height="216">

<p align="center"><b><font face="Tahoma" size="5" color="#6666FF">Please

click the links in the reports below.</font></b></td> Text displayed when report link is not yet accessed

</tr>

</table>

</div>

</center>

</body>

</html>

The main page or the main report is called by referring to XML code.

The file drillAcross.js contains the following code:

<%@ taglib uri="/infospc/tld/vrtl/vrtl.tld" prefix="vrtlReport" %>      

<center>

<vrtlReport:link method="show">

    <vrtlReport:run fileName="celerityDrillAcross.xml" fileOwner="netcool"/>

</vrtlReport:link> (XML file is called from this page)

</center>

 

Note:


  When the XML File has the code for the main report, the links in the report show up in the browser when drillAcross.jsp is loaded. In reference to our XML example, city.jsp is a call to one of the reports. Where City_V is a parameter in the JSP file that is passed when the link is clicked in the main report.


 

The file city.jsp contains the following code:

<%@ taglib uri="/infospc/tld/vrtl/vrtl.tld" prefix="vrtlReport" %>

<%

String sCityName = request.getParameter("City_V"); --city name is assigned to sCityName

if(sCityName == null)

   sCityName = "No City name passed.";

%>   

<center>

<vrtlReport:link method="show">

    <vrtlReport:run fileName="Product_Name_Details_Customer.par" fileOwner="netcool">

             <vrtlReport:useParameter name=ProductbvName>

                    <vrtlReport:constantData constant="<%=sCityName%>"/> -- Tag to run the report using sCityName as value

             </vrtlReport:useParameter>

    </vrtlReport:run>

</vrtlReport:link>

</center>

</html>

Once all the files are created use Upload Content portlet in Netcool Reporter 2.1 to upload the XML file into a Channel.

The Upload Content page is shown in Figure A10.

 

   Figure A10: Upload Content Portlet

The uploaded file will be in a channel called Drill Across Reports. The file is uploaded to INFOHOME/websqlbr/doc/celerityDrillAcross_1056.xml.