[reportlab-users] no error, but only one table of 2 is visible
Jean-Yves F. Barbier
12ukwn at gmail.com
Fri Jan 20 18:16:28 EST 2012
Hi list,
The following code don't produce any error, but there's only the one
cell table that is visible in the PDF :( and I don't understand why:
def docCie(self):
cieBox = Frame(CIE_BOX_X, CIE_BOX_Y, CIE_BOX_W, CIE_BOX_H,
leftPadding=5, bottomPadding=1,
rightPadding=5, topPadding=1, id=None,
showBoundary=CIE_BOX_SHOW_BOUNDARIES)
docCieName = self.styles['docCieName']
docCieInfo = self.styles['docCieInfo']
# OK: THIS ONE APPEARS IN THE PDF
# Cie name first
data = [[ Paragraph(self.cieInfo.cial, docCieName) ]]
tn = Table( data, 1*[9.25*cm], 1*[None] )
tn.setStyle(TableStyle([('ALIGN', (0, 0), (0, 0), 'CENTER'),
('VALIGN', (0, 0), (0, 0), 'MIDDLE')]))
# WHILE THIS ONE DOESN'T
# Cie info
data = [[Paragraph(u"<b>"+_(u"Phone:") +u"</b>", docCieInfo), Paragraph(self.cieInfo.phone, docCieInfo)],
[Paragraph(u"<b>"+_(u"Fax:") +u"</b>", docCieInfo), Paragraph(self.cieInfo.fax, docCieInfo)],
[Paragraph(u"<b>"+_(u"Mobile:")+u"</b>", docCieInfo), Paragraph(self.cieInfo.mobile, docCieInfo)],
[Paragraph(u"<b>"+_(u"TELEX:") +u"</b>", docCieInfo), Paragraph(self.cieInfo.telex, docCieInfo)],
[Paragraph(u"<b>"+_(u"E-mail:")+u"</b>", docCieInfo), Paragraph(self.cieInfo.email, docCieInfo)],
[Paragraph(u"<b>"+_(u"Site:") +u"</b>", docCieInfo), Paragraph(self.cieInfo.site, docCieInfo)]]
col0W = 1.70 * cm
col1W = CIE_BOX_W - col0W
ti = Table( data, 6*[col0W, col1W], 6*[None] )
ti.setStyle(TableStyle([('ALIGN', (0, 0), (-1, -1), 'LEFT'),
('VALIGN', (0, 0), (-1, -1), 'MIDDLE'),]))
# Add both tables to list, list to frame & frame to canvas
hdr_cie = []
hdr_cie.append(tn)
hdr_cie.append(ti)
cieBox.addFromList( hdr_cie, self.canvas )
JY
--
BOFH excuse #126:
it has Intel Inside
More information about the reportlab-users
mailing list