[reportlab-users] BOX, double line, line joint

Laszlo KREKACS laszlo.krekacs.list at gmail.com
Sun Jun 6 03:15:25 EDT 2010


Dear List,

I would like to make a simple table, with double lines around it.
Like this:
http://farm5.static.flickr.com/4035/4673529025_1c2baa01f8_b.jpg

No matter how I set the
('BOX', (0,0), (-1,-1), 3, colors.black, 0, None, None, 2, 2),

Table style line, I can only achieve one of the belowes results:
http://farm5.static.flickr.com/4015/4673529013_8524afe431_b.jpg
http://farm5.static.flickr.com/4009/4673529023_9d997d4cf3_b.jpg
http://farm5.static.flickr.com/4033/4673529021_c8a846ce77_b.jpg


Could somebody help me out, how I should code to have a
double line around the table?

Best regards,
Laszlo

ps: Here is the sourcecode:

import sys
from reportlab.platypus import *
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.rl_config import defaultPageSize

from reportlab.lib.pagesizes import A4,A5,landscape,portrait
from reportlab.lib.units import inch, cm
from reportlab.lib import colors

PAGE_HEIGHT=defaultPageSize[1]


from reportlab.lib.styles import getSampleStyleSheet
from reportlab.platypus import *
from reportlab.lib import colors

# Our container for 'Flowable' objects
elements = []

# A large collection of style sheets pre-made for us
styles = getSampleStyleSheet()

# A basic document for us to write to 'rl_hello_table.pdf'
doc = SimpleDocTemplate('rl_hello_table.pdf', pagesize=A4)

data = [
['First line', 'First line\'s value'],
['', 'Second line\'s value'],
['Subject:', 'Hmmz'],
['Place', 'Juppi'],
]

elements = []
table_with_style = Table(data, [6 * cm, 12 * cm])

table_with_style.setStyle(TableStyle(
[('FONT', (0, 0), (-1, -1), 'Times-Roman'),
('FONTSIZE', (0, 0), (-1, -1), 12),
('FONT', (0, 0), (-1, 0), 'Times-Bold'),
('BOX', (0,0), (-1,-1), 3, colors.black, 0, None, None, 2, 2),
('LINEBELOW', (0,-1), (-1,-1), 1, colors.black, 0, None, None, 2, 1),
('INNERGRID', (0, 0), (-1, -1), 0.25, colors.black),
('BOX', (0, 0), (-1, 0), 0.25, colors.green),
('ALIGN', (0, 0), (-1, 0), 'CENTER'),
])
)

elements.append(table_with_style)
doc.build(elements)


More information about the reportlab-users mailing list