|
<%
QueryBean QBean = new QueryBean();
UtilityBean UBean = new UtilityBean();
// Use this for formatting to zero decimal places.
DecimalFormat df0 = new DecimalFormat("#,###");
// Use this for formatting to one decimal place.
DecimalFormat df1 = new DecimalFormat("#,##0.0");
int progId = Integer.parseInt(request.getParameter("progid"));
Program p = QBean.getProgramInfo(progId);
String programName = p.getName();
int orgId = p.getOrgId();
%>
Funding History for <%= programName %>
|
|
Fiscal Year |
Total Grants |
Percentage Change |
Total Dollars |
Percentage Change |
<%
// We want to make sure we only display completed fiscal years.
// DCCPS started in FY 1998.
ResultSet rstHistory = QBean.getProgFYHistory(progId, 1998, UBean.getCurrentFY() - 1);
// In order to drill down from individual pie slices, we need to set a separate
// drill-down location for each slice. This can't easily be done using
// setResultSet, so we have to build up PCXML by hand.
String categories_pcxml = "";
String grantseries_pcxml = "";
String dollarseries_pcxml = "";
String ddUrl;
double pctIncreaseGrants;
double pctIncreaseDollars;
String pctIncreaseGrantsDisplay;
String pctIncreaseDollarsDisplay;
int fy;
while (rstHistory.next())
{
fy = rstHistory.getInt("fy");
ddUrl = "/overview/fyprogdetails.jsp?progid=" + progId + "&FY=" + fy;
pctIncreaseGrants = rstHistory.getDouble("pct_increase_grants");
if (rstHistory.wasNull())
pctIncreaseGrantsDisplay = "N/A";
else
pctIncreaseGrantsDisplay = df1.format(100 * pctIncreaseGrants);
pctIncreaseDollars = rstHistory.getDouble("pct_increase_dollars");
if (rstHistory.wasNull())
pctIncreaseDollarsDisplay = "N/A";
else
pctIncreaseDollarsDisplay = df1.format(100 * pctIncreaseDollars);
%>
<%= fy %> |
<%=rstHistory.getInt("num_grants")%>
|
<%=pctIncreaseGrantsDisplay%> |
$<%=df0.format(rstHistory.getInt("nci_total_awarded"))%> |
<%=pctIncreaseDollarsDisplay%> |
<%
categories_pcxml += "";
// We must use absolute paths for drilldown to make the D-link work correctly.
grantseries_pcxml += "";
dollarseries_pcxml += "";
} // end while loop
QBean.close();
String grant_pcxml = ""
+ "" + categories_pcxml + ""
+ "" + grantseries_pcxml + ""
+ "";
String dollar_pcxml = ""
+ "" + categories_pcxml + ""
+ "" + dollarseries_pcxml + ""
+ "";
%>
<%
NCIPopChartEmbedder histGraph = new NCIPopChartEmbedder();
histGraph.appearanceFile = "apfiles/dccps_public/fyhistory.pcxml";
histGraph.userAgent = request.getHeader("USER-AGENT");
histGraph.addPCXML(grant_pcxml + dollar_pcxml);
histGraph.pcScript = "Title.SetText(" + programName + " Portfolio by Fiscal Year)";
histGraph.width = 500;
histGraph.height = 379;
%>
<%= histGraph.getEmbeddingHTML() %>
|
|
|