def main(args): root_url = args[0] report_list_file = urllib.urlopen(root_url + '/' + args[1]) report_list = [] for line in report_list_file: line = line.strip() report_list.append(root_url + '/' + line) htTable = ht.TABLE() for i in range(5): report = PackageReport(report_list[i]) ##print report htTable.append(report.toHtml()) print ht.HTML(ht.BODY(htTable))
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
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))