本文整理匯總了Python中reportlab.platypus.TableStyle.spaceAfter方法的典型用法代碼示例。如果您正苦於以下問題:Python TableStyle.spaceAfter方法的具體用法?Python TableStyle.spaceAfter怎麽用?Python TableStyle.spaceAfter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類reportlab.platypus.TableStyle
的用法示例。
在下文中一共展示了TableStyle.spaceAfter方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: second_paragraph
# 需要導入模塊: from reportlab.platypus import TableStyle [as 別名]
# 或者: from reportlab.platypus.TableStyle import spaceAfter [as 別名]
def second_paragraph(self):
self.story.append(myParagraph(u"Nom du bénéficiaire : <b>" + self.facture_view.nom_prenom() + u"</b>", 'style1', spaceAfter=10))
self.story.append(myParagraph(u"Montant de la prestation", 'style1'))
self.story.append(myParagraph(u"<b>(" + self.facture_view.jours_prestation_string() + u")</b> Jours....................................<b>%.2f " % (self.facture_view.montant_presta()) + u"</b>€uros", 'style1', spaceAfter=25))
self.story.append(myParagraph(u"Arrêtée et certifiée conforme la présente facture à la somme de :", 'style1', spaceAfter=25))
table_style = TableStyle([('BOX', (0,0), (-1,-1), 0.25, black),
('BOX', (0,0), (-1,-1), 0.25, black),])
table_style.spaceAfter=25
table_data = [[myParagraph(u"<b>" + self.facture_view.montant_presta_word().upper() + u"</b>", 'style1', alignment=TA_CENTER),],]
self.story.append(Table(data=table_data, style=table_style))
示例2: frein_type_result
# 需要導入模塊: from reportlab.platypus import TableStyle [as 別名]
# 或者: from reportlab.platypus.TableStyle import spaceAfter [as 別名]
def frein_type_result(self, frein_type, resultat_list):
en_tete = ((StatParagraph("<b><i>" + frein_type + "</i></b>", 'style3'),
StatParagraph("<b><i>" + u"Frein le plus important" + "</i></b>", 'style3'),
StatParagraph("<b><i>" + u"Frein présent" + "</i></b>", 'style3')),)
data = tuple([(StatParagraph(categorie, 'style3'),
StatParagraph(str(nb_plus_imp), 'style3'),
StatParagraph(str(nb_all), 'style3'))
for (categorie, nb_plus_imp, nb_all) in resultat_list])
table_data = en_tete + data
table_style = TableStyle([('GRID', (0,0), (-1,-1), 0.25, black),])
table_style.spaceAfter=25
table_style.spaceBefore=25
self.story.append(Table(data=table_data, style=table_style))
示例3: tableau_intro
# 需要導入模塊: from reportlab.platypus import TableStyle [as 別名]
# 或者: from reportlab.platypus.TableStyle import spaceAfter [as 別名]
def tableau_intro(self):
style_tableau = TableStyle([('BOX', (0,0), (0,-1), 0.25, black),
('BOX', (1,0), (1,-1), 0.25, black),
('BOX', (2,0), (2,-1), 0.25, black),
('BOX', (0,0), (-1,0), 0.25, black),
('VALIGN',(0,0),(-1,-1),'TOP'),
])
style_tableau.spaceAfter = 10
tableau_data = [[MyParagraph(style='style3', text=u"<b>Bénéficiaire</b>"), MyParagraph(style='style3', text=u"<b>Référent</b>"), MyParagraph(style='style3', text=u"<b>Correspondant ALE</b>")],
[MyParagraph(style='style3', text=u"<b>Nom Prénom : <font color=black>"+self.bilanView.nomprenom()+"</font></b>"), MyParagraph(style='style3', text=u"<b>Nom Prénom : <font color=black>"+self.bilanView.CInomprenom()+"</font></b>"), MyParagraph(style='style3', text=u"<b>Nom Prénom : <font color=black>"+self.bilanView.ALEnomprenom()+"</font></b>")],
[MyParagraph(style='style3', text=u"<b>Identifiant n° : <font color=black>"+self.bilanView.idALE()+"</font></b>"), MyParagraph(style='style3', text=u"<b>Organisme : <font color=black>"+self.bilanView.organismeReferent()+"</font></b>"), MyParagraph(style='style3', text=u"<b>ALE : <font color=black>"+self.bilanView.ALEnom()+"</font></b>")],
[MyParagraph(style='style3', text=u"<b>Inscrit à ALE de: <font color=black>"+self.bilanView.incritALE()+"</font></b>"), MyParagraph(style='style3', text=u"<b>Tél : <font color=black>"+self.bilanView.refTel()+"</font></b>"), MyParagraph(style='style3', text=u"<b>Tél : <font color=black>"+self.bilanView.ALEtel()+"</font></b>")],
[MyParagraph(style='style3', text=u"<b>Tél : <font color=black>"+self.bilanView.LCtel()+"</font></b>"), MyParagraph(style='style3', text=u"<b>Mel : <font color=black>"+self.bilanView.refMail()+"</font></b>"), MyParagraph(style='style3', text=u"<b>Mel : <font color=black>"+self.bilanView.ALEmail()+"</font></b>")],
[MyParagraph(style='style3', text=u"<b>Mel : <font color=black>"+self.bilanView.LCmail()+"</font></b>"), None, None],
]
tableau = Table(data=tableau_data, style=style_tableau)
self.story.append(tableau)
示例4: __type_prestation_firstrow
# 需要導入模塊: from reportlab.platypus import TableStyle [as 別名]
# 或者: from reportlab.platypus.TableStyle import spaceAfter [as 別名]
def __type_prestation_firstrow(self):
self.elements.append(Paragraph("<u>Type de prestation</u>", styles.getSampleStyleSheet()['Heading2']))
typePresta_data = [self.__typepresta_checkbox()]
colonnesWidths = (20, 40, 20, 45, 20, 60, 20, 45, 20, 45, 20, 40, 20, 40, 20, 35, 20, 45)
#colonnesWidths = (20, 40, 20, 45, 20, 60, 20, 45, 20, 45, 20, 40, 20, 40)
typePresta_style = TableStyle([self.fontsize_style,
('VALIGN',(1,0),(1,0),'MIDDLE'),
('VALIGN',(3,0),(3,0),'MIDDLE'),
('VALIGN',(5,0),(5,0),'MIDDLE'),
('VALIGN',(7,0),(7,0),'MIDDLE'),
('VALIGN',(9,0),(9,0),'MIDDLE'),
('VALIGN',(11,0),(11,0),'MIDDLE'),
('VALIGN',(13,0),(13,0),'MIDDLE'),
('VALIGN',(13,0),(13,0),'MIDDLE'),
('VALIGN',(15,0),(15,0),'MIDDLE'),
('VALIGN',(17,0),(17,0),'MIDDLE'),
])
typePresta_style.spaceAfter = 10
typePresta_table = Table(data=typePresta_data, colWidths=colonnesWidths, style=typePresta_style)
self.elements.append(typePresta_table)
示例5: evenement_est
# 需要導入模塊: from reportlab.platypus import TableStyle [as 別名]
# 或者: from reportlab.platypus.TableStyle import spaceAfter [as 別名]
def evenement_est(response, lettre_commande):
# Our container for 'Flowable' objects
elements = []
# Main TableFontsize
petitePolice = 10
basePolice = 12
grandePolice = 14
fontsize_style = ("FONTSIZE", (0, 0), (-1, -1), basePolice)
rootPath = "/var/www/vhosts/backupmix.com/httpdocs/greta/administration/pdf/img/"
# Empty checkbox
empty_checkbox = Image(rootPath + "checkbox_empty.jpg", width=18, height=18)
# Checked checkbox
checked_checkbox = Image(rootPath + "checkbox_checked.jpg", width=18, height=18)
checks_box = (empty_checkbox, checked_checkbox)
# A basic document for us to write to 'rl_hello_platypus.pdf'
# doc = SimpleDocTemplate("fiche_evenemment.pdf", rightMargin=10, leftMargin=10, topMargin=0, bottomMargin=5)
doc = SimpleDocTemplate(response, rightMargin=10, leftMargin=10, topMargin=0, bottomMargin=5)
# Image en-tête
evenementEst_Image = Image(rootPath + "evenement_est.jpg", width=573, height=159)
evenementEst_Image.spaceAfter = 30
elements.append(evenementEst_Image)
# Create two 'Paragraph' Flowables and add them to our 'elements'
# elements.append(Paragraph("The Platypus", styles['Heading1']))
elements.append(Paragraph("<u>Type de prestation</u>", styles.getSampleStyleSheet()["Heading2"]))
# Tableau type de prestations
typePresta_data = [
[
empty_checkbox,
"BCA",
checked_checkbox,
"CIBLE",
empty_checkbox,
"OP CREA",
empty_checkbox,
"ECCP",
empty_checkbox,
"MOB",
empty_checkbox,
"STR",
empty_checkbox,
"EPCE",
]
]
colonnesWidths = (20, 55, 20, 65, 20, 80, 20, 55, 20, 55, 20, 50, 20, 50)
typePresta_style = TableStyle(
[
fontsize_style,
("VALIGN", (1, 0), (1, 0), "MIDDLE"),
("VALIGN", (3, 0), (3, 0), "MIDDLE"),
("VALIGN", (5, 0), (5, 0), "MIDDLE"),
("VALIGN", (7, 0), (7, 0), "MIDDLE"),
("VALIGN", (9, 0), (9, 0), "MIDDLE"),
("VALIGN", (11, 0), (11, 0), "MIDDLE"),
("VALIGN", (13, 0), (13, 0), "MIDDLE"),
]
)
typePresta_style.spaceAfter = 10
typePresta_table = Table(data=typePresta_data, colWidths=colonnesWidths, style=typePresta_style)
elements.append(typePresta_table)
location_style = styles.getSampleStyleSheet()["Normal"]
location_style.spaceAfter = 10
location_style.alignment = enums.TA_LEFT
elements.append(
Paragraph(
u"<font size='12'><b>Nom du prestataire: </b>%s</font>" % (lettre_commande.site.prestataire.nom,),
location_style,
)
)
elements.append(
Paragraph(
u"<font size='12'><b>Lieu de réalisation: </b>%s</font>" % (lettre_commande.site.nom,), location_style
)
)
elements.append(Paragraph(u"<font size='12'><b>Agence d'inscription: </b>%s</font>", location_style))
tableData = [
[
u"Nom-Prénom du DE:",
lettre_commande.nom + " " + lettre_commande.prenom,
"",
"",
u"N° Identifiant:",
lettre_commande.polemploi_id,
],
[
"Date du premier RDV:",
lettre_commande.ouverture_rdv.dateheure.date().strftime("%d/%m/%Y"),
"",
"",
#.........這裏部分代碼省略.........
示例6: aaa
# 需要導入模塊: from reportlab.platypus import TableStyle [as 別名]
# 或者: from reportlab.platypus.TableStyle import spaceAfter [as 別名]
def aaa(response, lettre_commande, premierRdv):
# Our container for 'Flowable' objects
elements = []
# Main TableFontsize
petitePolice = 10
basePolice = 12
grandePolice = 14
fontsize_style = ('FONTSIZE',(0,0),(-1,-1),basePolice)
rootPath = '/var/www/vhosts/backupmix.com/httpdocs/greta/administration/pdf/img/'
#Empty checkbox
empty_checkbox = Image(rootPath+"checkbox_empty.jpg", width=18, height=18)
#Checked checkbox
checked_checkbox = Image(rootPath+"checkbox_checked.jpg", width=18, height=18)
# A basic document for us to write to 'rl_hello_platypus.pdf'
#doc = SimpleDocTemplate("fiche_evenemment.pdf", rightMargin=10, leftMargin=10, topMargin=0, bottomMargin=5)
doc = SimpleDocTemplate(response, rightMargin=10, leftMargin=10, topMargin=0, bottomMargin=5)
#Image en-tête
evenementEst_Image = Image(rootPath+"evenement_est.jpg", width=573, height=159)
evenementEst_Image.spaceAfter = 30
elements.append(evenementEst_Image)
# Create two 'Paragraph' Flowables and add them to our 'elements'
#elements.append(Paragraph("The Platypus", styles['Heading1']))
elements.append(Paragraph("<u>Type de prestation</u>", styles.getSampleStyleSheet()['Heading2']))
# Tableau type de prestations
typePresta_data = [[empty_checkbox,'BCA',checked_checkbox,'CIBLE',empty_checkbox,'OP CREA',empty_checkbox,'ECCP',empty_checkbox,'MOB',empty_checkbox,'STR',empty_checkbox,'EPCE']]
colonnesWidths = (20, 55, 20, 65, 20, 80, 20, 55, 20, 55, 20, 50, 20, 50)
typePresta_style = TableStyle([fontsize_style,
('VALIGN',(1,0),(1,0),'MIDDLE'),
('VALIGN',(3,0),(3,0),'MIDDLE'),
('VALIGN',(5,0),(5,0),'MIDDLE'),
('VALIGN',(7,0),(7,0),'MIDDLE'),
('VALIGN',(9,0),(9,0),'MIDDLE'),
('VALIGN',(11,0),(11,0),'MIDDLE'),
('VALIGN',(13,0),(13,0),'MIDDLE'),
])
typePresta_style.spaceAfter = 10
typePresta_table = Table(data=typePresta_data, colWidths=colonnesWidths, style=typePresta_style)
elements.append(typePresta_table)
location_style = styles.getSampleStyleSheet()['Normal']
location_style.spaceAfter = 10
location_style.alignment = enums.TA_LEFT
elements.append(Paragraph("<font size='14'><b>Nom du prestataire: </b>prestataire x</font>", location_style))
elements.append(Paragraph("<font size='14'><b>Lieu de réalisation: </b>lieu x</font>", location_style))
elements.append(Paragraph("<font size='14'><b>Agence d'inscription: </b>agence x</font>", location_style))
tableData = [["Nom-Prénom du DE:", "Gerar Lambert", "", "","N° Identifiant:" ,"21356"],
["Date du premier RDV:", "jj/mm/aaaa", "", "","Heure du RDV:" ,"hh:mm"],
]
tableStyle = TableStyle([fontsize_style,
#('ALIGN', (0,0), (5,0), 'RIGHT'),
('FONT', (0,0), (0,1), 'Times-Bold'),
('FONT', (4,0), (4,1), 'Times-Bold'),
('ALIGN', (0,0), (-1,-1), 'LEFT'),
])
table = Table(tableData,style=tableStyle)
table.hAlign = 0
#table.leftPadding = 0
table.spaceAfter = 20
elements.append(table)
# Escpace
#space1 = Spacer(width=450, height=20)
#elements.append(space1)
# Barre Horizontale
barreHorizontale = Image(rootPath+"barre_horizontale.jpg", width=520, height=6)
barreHorizontale.spaceAfter = 20
elements.append(barreHorizontale)
# Tableaux Premier RDV
# DEMARRAGE DE PRESTATION
demarragePresta_data = [[empty_checkbox, "A DEMARRE LA PRESTATION"],]
demarragePresta_style = TableStyle([('FONTSIZE', (1,0), (1,0), grandePolice),
('LEADING', (1,0), (1,0), 3),
('VALIGN',(1,0),(1,0),'TOP'),
])
demarragePresta = Table(demarragePresta_data, style=demarragePresta_style)
demarragePresta.hAlign = 0
demarragePresta.spaceAfter = 10
#.........這裏部分代碼省略.........