Пример #1
0
 def toHtml(self):
     """Eventually, this method will return the HTML text for
     representing this report as an HTML table row
     """
     tableRow = ht.TR()
     tableRow.append(ht.TD(self.name))
     tableRow.append(ht.TD(self.version))
     ## FIXME: want to use CSS classes and not define color explicitly
     status = ht.FONT(self.status, color=self.statusColor)
     tableRow.append(ht.TD(ht.A(status, href=self.outputUrl)))
     return tableRow
Пример #2
0
def showReport(doc, rpt):
    rpt.setupReport()
    table = html.TABLE(title=rpt.getTitle())
    doc.append(table)

    tr = html.TR()
    table.append(tr)
    for col in rpt.columns:
        tr.append(html.TH(col.getLabel()))

    for row in rpt:
        tr = html.TR()
        table.append(tr)
        for col in rpt.columns:
            v = col.getCellValue(row)
            if v is None:
                tr.append(html.TD(" "))
            else:
                s = text2html(col.format(v).decode())
                tr.append(html.TD(s))
Пример #3
0
    def report(self,rpt):
        self.append(html.H2(rpt.getTitle()))
        t=html.TABLE()
        self.append(t)

        tr=html.TR()
        t.append(tr)
        for col in rpt.columns:
            tr.append(html.TH(col.getLabel()))

        for row in rpt.rows(self):
            tr=html.TR()
            t.append(tr)
            i=0
            for col in rpt.columns:
                tr.append( html.TD(
                    self.cell2html(col.datacol,row.values[i])
                    ))
                i+=1