public static void makereport(OutputStream outs, Report rep) throws IOException {
        PrintWriter out = new PrintWriter(new OutputStreamWriter(outs, "UTF-8"));
        out.print(htmlhead("Error Report"));
        out.println("<h1>Error Report</h1>");

        out.println("<p>Reported at: " + htmlq(dfmt.format(new Date(rep.time))) + "</p>");
        out.println("<h2>Properties</h2>");
        out.println("<table>");
        out.println("<tr><th>Name</th><th>Value</th>");
        SortedSet<String> keys = new TreeSet<String>(rep.props.keySet());
        for (String key : keys) {
            Object val = rep.props.get(key);
            String vals;
            if (val instanceof Number) {
                vals = ifmt.format((Number) val);
            } else if (val instanceof Date) {
                vals = dfmt.format((Number) val);
            } else if (val == null) {
                vals = "(null)";
            } else {
                vals = val.toString();
            }
            out.print("    <tr>");
            out.print("<td>" + htmlq(key) + "</td><td>" + htmlq(vals) + "</td>");
            out.println("    </tr>");
        }
        out.println("</table>");

        out.println("<h2>Exception chain</h2>");
        for (Throwable t = rep.t; t != null; t = t.getCause()) {
            out.println("<h3>" + htmlq(t.getClass().getName()) + "</h3>");
            out.println("<p>" + htmlq(t.getMessage()) + "</p>");
            out.print(htmlbt(t.getStackTrace()));
        }

        out.print(htmltail());
        out.flush();
    }