home *** CD-ROM | disk | FTP | other *** search
- <%@ page language="java"
- session="true"
- import="com.websina.bean.*,com.websina.util.*,com.websina.util.log.Log"
- errorPage="error.jsp"
- %>
- <%@ include file="_charset.jspf" %>
- <html>
- <head>
- <title>Summary Report</title>
- <LINK rel="StyleSheet" href="css/styles.css" type="text/css">
- </head>
- <body topmargin=0>
- <%@ include file="_cache.jspf" %>
- <%
- Label label = Label.getInstance();
- com.websina.bean.Report report =
- (com.websina.bean.Report)session.getAttribute("summary_report");
- if (report == null || report.isEmpty()) {
- out.print("<center><font color=red><b>");
- out.print(" <br> <br>"+MessageCode.get("servlet.report.no_summary_report"));
- out.print("</b></font></center>");
- return;
- }
- String xName = report.getXName();
- String yName = report.getYName();
-
- String projectId = report.getProjectId();
- Project conf = Project.getInstance(projectId);
- DateTime dateTime = (DateTime)session.getAttribute("datetime");
-
- com.websina.util.Field xField = report.getXField();
- com.websina.util.Field yField = report.getYField();
-
- String[] x = xField.getValue();
- String[] xDisplay = xField.getText();
- String[] y = yField.getValue();
- String[] yDisplay = yField.getText();
- int[] total = new int[x.length + 1];
- for (int i=0; i<=x.length; i++) {
- total[i] = 0;
- }
- %>
- <center>
- <br>
- <font size="+2"><b><%=conf.getName()%></b></font>
- <font size="+1">Summary Report</font>
- <br>
-
- <%=label.get(yName, projectId)%> versus <%=label.get(xName, projectId)%>
- <br><%=dateTime.localTime()%>
-
- <table cellspacing=1 cellpadding=2 border=0>
- <tr><td colspan=<%=(x.length+2)%> align=right>
- <a href="<%=request.getContextPath()%>/servlet/export/summary.csv?type=3" title="Export to CSV">Export <img src="img/excel.gif" border=0></a>
- </td></tr>
- <tr class="header">
- <td> </td>
- <% for (int i=0; i<x.length; i++) {
- %>
- <td align=center> <%= xDisplay[i] %></td>
- <% } %>
- <td align=center>Total </td>
- </tr>
-
- <% for (int i=0; i<y.length; i++) {
- int xTotal = 0;
- %>
- <tr><td class="e8" align=right><%= yDisplay[i] %> </td>
- <% for (int j=0; j<x.length; j++) {
- int count = report.getCount(x[j], y[i]);
- xTotal += count;
- total[j] += count;
- total[x.length] += count;
- %>
- <td class="f1" align=center> <%=Integer.toString(count)%></td>
- <% } %> <td class="f1" align=center><%=xTotal%></td></tr>
- <% } %>
-
- <tr><td class="e8" align=right>Total </td>
- <% for (int j=0; j<=x.length; j++) {
- %>
- <td class="f1" align=center><%=total[j] %></td>
- <% } %> </tr>
- </table>
- </center>
- </body>
- </html>
-