예제 #1
0
  public void makeReport(HTMLReportArchive report) {
    ResultsTable table = new ResultsTable();

    StringBuffer b = report.htmlDocument();
    StringBuffer d = report.dataDocument();

    b.append("<table>\n");
    // Do the headers
    b.append("<tr>\n");
    d.append("#");
    for (int c = 0; c < table.getColumnCount(); c++) {
      b.append("<th>");
      b.append(table.getColumnName(c));
      d.append(table.getColumnName(c));
      b.append("</th>\n");
      d.append("\t");
    }
    b.append("</tr>\n");
    d.append("\n");

    // Do the rows
    for (int r = 0; r < table.getRowCount(); r++) {
      b.append("<tr>\n");
      for (int c = 0; c < table.getColumnCount(); c++) {
        b.append("<td>");
        b.append(table.getValueAt(r, c));
        d.append(table.getValueAt(r, c));
        b.append("</td>\n");
        d.append("\t");
      }
      b.append("</tr>\n");
      d.append("\n");
    }

    b.append("</table>\n");
  }