def heading_content(self, heading_text, align="left", fontSize=12, sep=0): style = _ParagraphStyle("body") style.alignment = _TA_LEFT if align == "left" else _TA_CENTER if align == "center" else _TA_RIGHT if align == "right" else _TA_JUSTIFY _setattribs(style, [('fontName', 'Helvetica-Bold'), ('fontSize', fontSize), ('textColor', 'black'), ('splitLongWords', 1)]) self.elements += [ _Paragraph(heading_text, style), _Spacer(0, sep * _cm) ]
def parse_datatable(self, matrix_content, fix_content = True, footer=False, towCols=False, before_pg=False, after_pg=False, cellsW=dict()): if not towCols: tb = _Table((self.__parse_datatable(matrix_content, footer=footer) if fix_content else matrix_content), repeatRows=1, **(dict(colWidths=1.5*_cm) if cellsW else dict())) else: tb = _Table(self.__parse_datatable2cols(matrix_content)) if cellsW.keys(): for idx, val in cellsW.iteritems(): tb._argW[idx] = float(val)*_cm tb.setStyle(_tbstyle if not towCols else _tbstyle2cols) self.elements += [_PageBreak()] if before_pg else list() self.elements += [tb, _Spacer(0, .5*_cm)] self.elements += [_PageBreak()] if after_pg else list()
def parse_datatable(self, matrix_content, fix_content=True, footer=False, towCols=False, before_pg=False, after_pg=False, cellsW=dict()): if not towCols: tb = _Table((self.__parse_datatable(matrix_content, footer=footer) if fix_content else matrix_content), repeatRows=1, **(dict(colWidths=1.5 * _cm) if cellsW else dict())) else: tb = _Table(self.__parse_datatable2cols(matrix_content)) if cellsW.keys(): for idx, val in cellsW.iteritems(): tb._argW[idx] = float(val) * _cm tb.setStyle(_tbstyle if not towCols else _tbstyle2cols) self.elements += [_PageBreak()] if before_pg else list() self.elements += [tb, _Spacer(0, .5 * _cm)] self.elements += [_PageBreak()] if after_pg else list()
def heading_content(self, heading_text, align="left", fontSize=12, sep=0): style = _ParagraphStyle("body") style.alignment = _TA_LEFT if align=="left" else _TA_CENTER if align=="center" else _TA_RIGHT if align=="right" else _TA_JUSTIFY _setattribs(style, [('fontName','Helvetica-Bold'),('fontSize',fontSize),('textColor','black'),('splitLongWords',1)]) self.elements += [_Paragraph(heading_text, style), _Spacer(0, sep*_cm)]