[reportlab-users] Spaces stripped out....

Andy Robinson andy at reportlab.com
Fri Apr 25 03:55:08 EDT 2014


Thanks for clarifying.

If you are happy with fixed width fonts and what I would call "old
style reporting", then you need to use a Preformatted instead of a
Paragraph. It respects spaces (at least leading ones) and line breaks
so will do exactly what you want.

However our own tables have been designed for handling this kind of
thing efficiently and flexibly. If you just put naked text strings
in a table cell, the table controls the formatting and you have
complete control of column widths, column alignment (including decimal
alignment) and many more things in the table style. So you can design
a TableStyle once and use it many times, and just push out
lists-of-lists of data and get very nice tables.

There are plenty of examples in the test suite. These days many
people install from pip/easy_install so don't have it, but if you
download the source or browse on
http://bitbucket.org/rptlab/reportlab/src/ , there is a script
tests/test_platypus_tables.py.


https://bitbucket.org/rptlab/reportlab/src/b07c2c8b02de8a60984b00766f8d6bf77ca72266/tests/test_platypus_tables.py?at=default

(Sorry about long link...)

On 24 April 2014 22:14, Richard Grigonis <richardg at newsmax.com> wrote:

> Platypus. I've been looking at the table code too, which seems a bit

> overkill, but it would do page numbers & continued headings....

>

> Richard Grigonis

> richardg at newsmax.com

> Newsmax Media, Inc.

>

> www.newsmax.com

>

> P.O. Box 20989

> West Palm Beach, FL 33416

> (561) 686-1165 ext. 7740

> (561) 686-8640 Fax

> (610) 780-3730 Cell

>

>

> On Thu, Apr 24, 2014 at 4:53 PM, Andy Robinson <andy at reportlab.com> wrote:

>>

>> When you say "creating a tables", are you using Platypus, or the

>> canvas with drawString / textObject? They are radically different.

>> Depending on your answer I will explain how to do it..

>>

>> - Andy

>

>




--
Andy Robinson
Managing Director
ReportLab Europe Ltd.
Thornton House, Thornton Road, Wimbledon, London SW19 4NG, UK
Tel +44-20-8405-6420


More information about the reportlab-users mailing list