home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 May / CMCD0505.ISO / Software / Shareware / Programare / bugzero / jsp / summary.jsp < prev    next >
Encoding:
Text File  |  2004-10-04  |  2.6 KB  |  88 lines

  1. <%@ page language="java"
  2.     session="true"
  3.     import="com.websina.bean.*,com.websina.util.*,com.websina.util.log.Log"
  4.     errorPage="error.jsp"
  5. %>
  6. <%@ include file="_charset.jspf" %>
  7. <html>
  8. <head>
  9. <title>Summary Report</title>
  10. <LINK rel="StyleSheet" href="css/styles.css" type="text/css">
  11. </head>
  12. <body topmargin=0>
  13. <%@ include file="_cache.jspf" %>
  14. <%      
  15.   Label label = Label.getInstance();        
  16.   com.websina.bean.Report report = 
  17.     (com.websina.bean.Report)session.getAttribute("summary_report");
  18.   if (report == null || report.isEmpty()) {
  19.     out.print("<center><font color=red><b>");
  20.     out.print(" <br> <br>"+MessageCode.get("servlet.report.no_summary_report"));
  21.     out.print("</b></font></center>");
  22.     return;
  23.   }
  24.   String xName = report.getXName();
  25.   String yName = report.getYName();
  26.  
  27.   String projectId = report.getProjectId();
  28.   Project conf = Project.getInstance(projectId);
  29.   DateTime dateTime = (DateTime)session.getAttribute("datetime");
  30.  
  31.   com.websina.util.Field xField = report.getXField();
  32.   com.websina.util.Field yField = report.getYField();
  33.  
  34.   String[] x = xField.getValue();
  35.   String[] xDisplay = xField.getText();
  36.   String[] y = yField.getValue();
  37.   String[] yDisplay = yField.getText();
  38.   int[] total = new int[x.length + 1];
  39.   for (int i=0; i<=x.length; i++) {
  40.      total[i] = 0; 
  41.   }
  42. %>
  43. <center>
  44.  <br>
  45. <font size="+2"><b><%=conf.getName()%></b></font>
  46. <font size="+1">Summary Report</font>
  47. <br>
  48.  
  49. <%=label.get(yName, projectId)%> versus <%=label.get(xName, projectId)%>
  50. <br><%=dateTime.localTime()%>
  51.  
  52. <table cellspacing=1 cellpadding=2 border=0>
  53. <tr><td colspan=<%=(x.length+2)%> align=right>
  54. <a href="<%=request.getContextPath()%>/servlet/export/summary.csv?type=3" title="Export to CSV">Export <img src="img/excel.gif" border=0></a>
  55. </td></tr>
  56. <tr class="header">
  57. <td> </td>
  58.   <% for (int i=0; i<x.length; i++) {
  59.   %>
  60. <td align=center> <%= xDisplay[i] %></td>
  61.   <% } %>
  62. <td align=center>Total </td>
  63. </tr>
  64.  
  65.   <% for (int i=0; i<y.length; i++) {
  66.        int xTotal = 0; 
  67.   %>
  68. <tr><td class="e8" align=right><%= yDisplay[i] %> </td>
  69.      <% for (int j=0; j<x.length; j++) {
  70.           int count = report.getCount(x[j], y[i]);
  71.           xTotal += count;
  72.           total[j] += count; 
  73.           total[x.length] += count;
  74.      %>
  75. <td class="f1" align=center> <%=Integer.toString(count)%></td>
  76.      <% } %> <td class="f1" align=center><%=xTotal%></td></tr>
  77.   <% } %>
  78.  
  79. <tr><td class="e8" align=right>Total </td>
  80.      <% for (int j=0; j<=x.length; j++) {
  81.      %>
  82. <td class="f1" align=center><%=total[j] %></td>
  83.      <% } %> </tr>
  84. </table>
  85. </center>
  86. </body>
  87. </html>
  88.