[reportlab-users] How to put a newline break in a XPreformatted?

Shigesan Takuya tjleny at hotmail.com
Fri Feb 29 08:40:45 EST 2008



t = Table([[
[XPreformatted(" This is a very long long long
string to be printed in a PDF Form with a checkbox at the beginning
of \n the first line. Again, a repeated sentence: This is a very long
long long string\n to be printed in a PDF Form together with a
checkbox at the beginning of the first line", someParagraphStyle),
drawCheckBox]]])

Shige, the table you've shown has only one cell that contains a list of things.

I suspect it sould be clearer if we did the data assignments separately

ie

x=XPreformatted(" This is a very long long long
string to be printed in a PDF Form with a checkbox at the beginning
of \n the first line. Again, a repeated sentence: This is a very long
long long string\n to be printed in a PDF Form together with a
checkbox at the beginning of the first line", someParagraphStyle)

then your table looks like

t = Table([[[x,drawCheckBox]]])

ie 1 row, 1 column 1 cell with list contents. The cell will contain the contents
drawn in order.

If you make the table have two columns in the one row then both can have the
same alignment. I'm not sure which side you want the check box, but you could do

t = Table([[x,drawCheckBox]])


or

t= Table([[drawCheckBox,x]])


t.setStyle([('VALIGN',(0,0),(1,-1),'TOP')])


===========================================================================================
Hi Robin,

Thank you very much for your help and advice!
I have now sorted the problem out, & managed to draw a proper checkboxes along with my strings..
=D

Shige


_________________________________________________________________
Get your free suite of Windows Live services today!
http://www.get.live.com/wl/all
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20080229/ebbb9ba8/attachment.html>


More information about the reportlab-users mailing list