Beispiel #1
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
Beispiel #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))