Sign in to follow this  
ravivarma434

Drill down reports using JSP

Recommended Posts

Hi Team.

 

We have generated two reports using JSPs. (Main & Sub report). 

 

Both are JSP pages & report is generating perfectly. We want to link both the charts. 

When click on pie chart in the first chart, it should navigate to second chart. Both used the web services internally with JSP useBean tags. Attached the Main JSP here for your reference. How to link the second JSP in this chart. 

 

-------------------------------------------------------------------------------------------

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://www.fusioncharts.com/jsp/core"prefix="fc"%>
<%@page import="org.json.JSONObject"%>
<%
/* In this page the chart is finally displayed. */
%>
<c:set var="folderPath" value="../Chart/FusionCharts/" />
<c:set var="jsPath" value="${folderPath}" scope="request" />
 
<script src="${jsPath}fusioncharts.js"></script>
 
<jsp:useBean id="product" class="com.aasc.model.DataBean">
<c:set var="jsonArray" value="${product.jsonArray}"/>
<c:set var="chartId" value="NormalCahrt"/>
<c:set var="chartType" value="pie3d"/>
<c:set var="caption" value="AA-Freight Audit Report"/>
<c:set var="subCaption" value="UPS"/>
<c:set var="paletteColors" value="#f2c500,#f45b00,#8e0000"/>
<c:set var="width" value="500"/>
<c:set var="height" value="300"/>
<c:set var="exportEnabled" value="1"/>
<c:set var="enableSmartLabels" value="0"/>
<c:set var="showLegend" value="1"/>
<c:set var="legendBorderAlpha" value="0"/>
<c:set var="captionFontSize" value="20"/>
<c:set var="subcaptionFontSize" value="16"/>
<c:set var="useDataPlotColorForLabels" value="1"/>
 
<%
JSONObject chartObject = new JSONObject();
chartObject.put("caption", pageContext.getAttribute("caption"));
chartObject.put("subcaption", pageContext.getAttribute("subCaption"));
chartObject.put("paletteColors", pageContext.getAttribute("paletteColors"));
chartObject.put("exportEnabled", pageContext.getAttribute("exportEnabled"));
chartObject.put("showLegend", pageContext.getAttribute("showLegend"));
chartObject.put("legendBorderAlpha", pageContext.getAttribute("legendBorderAlpha"));
chartObject.put("enableSmartLabels", pageContext.getAttribute("enableSmartLabels"));
chartObject.put("captionFontSize", pageContext.getAttribute("captionFontSize"));
chartObject.put("subcaptionFontSize", pageContext.getAttribute("subcaptionFontSize"));
chartObject.put("useDataPlotColorForLabels", pageContext.getAttribute("useDataPlotColorForLabels"));
//put all together in final JSON Object
JSONObject jsonObject = new JSONObject();
jsonObject.put("chart", chartObject);
jsonObject.put("data", pageContext.getAttribute("jsonArray"));
String json = jsonObject.toString();
pageContext.setAttribute("json", json);
%>
<fc:render chartId="${chartId }" swfFilename="${chartType}" width="${width}"
height="${height}" debugMode="false" registerWithJS="false"
jsonData="${json}" />
</jsp:useBean>
<br />
<br />
 
-----------------------------------------------------------------

 

Best Regards,

Varma

Share this post


Link to post
Share on other sites

Hey,

 

Yes, it can be done with the help of linked charts. Providing the docs link from earlier version for reference:

http://docs.fusioncharts.com/charts/contents/Code/J2EE/JSP_Drill.html

 

Hope this helps.

 

Hi Swarnam,

 

Thanks for the response. I gone through this link, which is not similar with my requirement.

How this will best fit into the jsp code that I shared in. Please let me know.

 

Regards,

Varma

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this