python - How to insert a carriage return in a ReportLab paragraph? -
is there way insert carriage return in paragraph in reportlab? trying concatenate "\n" paragraph string isnt working.
title = paragraph("title" + "\n" + "page", mystyle)
i want since putting names cells , want control how many names lie on line in cell (ideally 1). 1 cell can contain multiple names within cell each name on own line, hence need insert new line.
at point im getting flowable large frame error (i think has table being large or having many merged rows). way can think suppress have 1 name per line in cell can limit table size based on count of names , segment tables smaller tables.
seems there has cleaner way of doing this. suggestions?
a paragraph
flowable
in reportlab. newline character not work within flowable in way want to. if paragraph
within table (as suggest), might consider creating cell without flowable. example, might this:
data = [['title\npage', 'name', 'exists'], # note newline character ['', 'george', 'true']] t = table(data, style=style_) ...
the above example make first data cell 2 rows tall (but part of same cell).
if need preserve style of paragraph
flowable, however, insert 2 paragraphs same cell:
title1 = paragraph("title", mystyle) title2 = paragraph("page", mystyle) cell = [title1, title2] # put in single cell of table
Comments
Post a Comment