def _get_elements(self):
        elements = []
        table_style_data = [('TEXTCOLOR', (0, 0), (-1, -1), colors.black),
                            ('VALIGN', (0, 0), (-1, -1), 'TOP'),
                            ('LINEBELOW', (0, 0), (-1, -1), 1, colors.black),
                            ('BOX', (0, 0), (-1, -1), 1, colors.black),
                            ('BOX', (0, 0), (0, -1), 1, colors.black),
                            ('BACKGROUND', (0, 0), (1, 0), colors.lightblue)]

        table_style = TableStyle(table_style_data)
        table_style.spaceAfter = 25

        heading_style = TableStyle(table_style_data)
        heading_style.spaceAfter = 25
        heading_style.add('SPAN', (0, 0), (1, 0))
        heading_style.add('ALIGN', (0, 0), (1, 0), 'CENTER')

        localised_date_str = self._get_localised_date(self.response['submitted_at'])

        heading_data = self.style.get_heading_data(self.survey['title'], self.response['collection']['instrument_id'],
                                                   self.response['metadata']['ru_ref'], localised_date_str)

        heading = Table(heading_data, style=heading_style, colWidths='*')

        elements.append(heading)

        for question_group in filter(lambda x: 'title' in x, self.survey['question_groups']):

            section_heading = True

            for question in filter(lambda x: 'text' in x, question_group['questions']):
                if question['question_id'] in self.response['data']:
                    try:
                        answer = str(self.response['data'][question['question_id']])
                    except KeyError:
                        answer = ''

                    # Output the section header if we haven't already
                    # Checking here so that whole sections are suppressed
                    # if they have no answers.
                    if section_heading:
                        elements.append(HRFlowable(width="100%"))
                        elements.append(Paragraph(question_group['title'], self.style.style_sh))
                        section_heading = False

                    # Question not output if answer is empty
                    text = question.get("text")
                    if not text[0].isdigit():
                        text = " ".join((question.get("number", ""), text))
                    elements.append(Paragraph(text, self.style.style_n))
                    elements.append(Paragraph(answer, self.style.style_answer))

        return elements
Пример #2
0
 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))
Пример #3
0
 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))
Пример #4
0
 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)
Пример #5
0
 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)
Пример #6
0
def getTableStyle(tSty=None, tSpaceAfter=0, tSpaceBefore=0):
    """
    :param tSty: TableStyle(tSty) default is None
    :param tSpaceBefore: space before table, default: 0
    :param tSpaceAfter: space after table, default: 0

    :returns: TableStyle object

    use the add method of that object to add style commands e.g.:
    to add a background in the first row::

        tableStyle.add(("BACKGROUND",(0,0),(2,0),ar.colors.green))
        tableStyle.add(("BACKGROUND",(2,0),(4,0),ar.colors.lavender))

    to change text color on the first two columns::

        tableStyle.add(("TEXTCOLOR",(0,0),(1,-1),ar.colors.red))

    to change alignment of all cells to 'right'::

        tableStyle.add(("ALIGN",(0,0),(-1,-1),"RIGHT"))

    to add a grid for the whole table::

        tableStyle.add(("GRID",(0,0),(-1,-1),0.5,ar.colors.black))

    some further examples of command entries::

        ("ALIGN",(0,0),(1,-1),"LEFT"),
        ("ALIGN",(1,0),(2,-1),"RIGHT"),
        ("ALIGN",(-2,0),(-1,-1),"RIGHT"),
        ("GRID",(1,1),(-2,-2),1,ar.colors.green),
        ("BOX",(0,0),(1,-1),2,ar.colors.red),
        ("LINEABOVE",(1,2),(-2,2),1,ar.colors.blue),
        ("LINEBEFORE",(2,1),(2,-2),1,ar.colors.pink),
        ("BACKGROUND", (0, 0), (0, 1), ar.colors.pink),
        ("BACKGROUND", (1, 1), (1, 2), ar.colors.lavender),
        ("BACKGROUND", (2, 2), (2, 3), ar.colors.orange),
        ("BOX",(0,0),(-1,-1),2,ar.colors.black),
        ("GRID",(0,0),(-1,-1),0.5,ar.colors.black),
        ("VALIGN",(3,0),(3,0),"BOTTOM"),
        ("BACKGROUND",(3,0),(3,0),ar.colors.limegreen),
        ("BACKGROUND",(3,1),(3,1),ar.colors.khaki),
        ("ALIGN",(3,1),(3,1),"CENTER"),
        ("BACKGROUND",(3,2),(3,2),ar.colors.beige),
        ("ALIGN",(3,2),(3,2),"LEFT"),
        ("GRID", (0,0), (-1,-1), 0.25, ar.colors.black),
        ("ALIGN", (1,1), (-1,-1), "RIGHT")
        ("FONTSIZE", (1,0), (1,0), self.fontsizes["table"])

        ('SPAN',(1,0),(1,-1))
    """
    if not tSty:
        tSty = list()
    else:
        pass

    tableStyle = TableStyle(tSty)

    tableStyle.spaceAfter = tSpaceAfter
    tableStyle.spaceBefore = tSpaceBefore

    return tableStyle
Пример #7
0
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"),
            "",
            "",
            "Heure du RDV:",
            lettre_commande.ouverture_rdv.dateheure.time().strftime("%H:%M"),
        ],
    ]
    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 = [
        [
            eval(get_image_ouverture_rdv(lettre_commande.ouverture_rdv, ouvertureRdv.PRESENT_C)),
            "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
    elements.append(demarragePresta)

    # REFUS PRESTATION
    refusPresta_data = [
        [
            eval(get_image_ouverture_rdv(lettre_commande.ouverture_rdv, ouvertureRdv.PRESENT_NC)),
            "N'A PAS ADHERE A LA PRESTATION",
        ],
        [None, "Indiquer le motif: " + get_comments_ouverture_rdv(lettre_commande.ouverture_rdv)],
    ]
    refusPresta_style = TableStyle(
        [
            ("FONTSIZE", (1, 0), (1, 0), grandePolice),
            ("VALIGN", (1, 0), (1, 0), "TOP"),
            ("FONTSIZE", (1, 1), (1, 1), petitePolice),
        ]
    )
    refusPresta = Table(refusPresta_data, style=refusPresta_style)
    refusPresta.hAlign = 0
    refusPresta.spaceAfter = 10
    elements.append(refusPresta)

    # ABSENT
    absentPresta_data = [
        [eval(get_image_ouverture_rdv(lettre_commande.ouverture_rdv, ouvertureRdv.ABSENT)), "NE S'EST PAS PRESENTE"]
    ]
    absentPresta_style = TableStyle([("FONTSIZE", (1, 0), (1, 0), grandePolice), ("VALIGN", (1, 0), (1, 0), "TOP")])
    absentPresta = Table(absentPresta_data, style=absentPresta_style)
    absentPresta.hAlign = 0
    absentPresta.spaceAfter = 10
    elements.append(absentPresta)

    # REPORT
    reportPresta_data = [
        [
            eval(get_image_ouverture_rdv(lettre_commande.ouverture_rdv, ouvertureRdv.REPORT)),
            "A DEMANDE AU PRESTATAIRE UN REPORT DU PREMIER RDV",
        ],
        [None, "(8 jours maxi)"],
    ]
    reportPresta_style = TableStyle(
        [
            ("FONTSIZE", (1, 0), (1, 0), grandePolice),
            ("FONTSIZE", (1, 1), (1, 1), basePolice),
            ("VALIGN", (1, 0), (1, 0), "TOP"),
        ]
    )
    reportPresta = Table(reportPresta_data, style=reportPresta_style)
    reportPresta.hAlign = 0
    reportPresta.spaceAfter = 10
    elements.append(reportPresta)

    newDateTime_data = [
        [
            None,
            "Date du nouveau RDV: " + get_newdate_ouverture_rdv(lettre_commande.ouverture_rdv),
            "Heure du nouveau RDV: " + get_newtime_ouverture_rdv(lettre_commande.ouverture_rdv),
        ]
    ]
    newDateTime_style = TableStyle([("FONTSIZE", (0, 0), (-1, -1), basePolice)])
    newDateTime = Table(newDateTime_data, style=newDateTime_style)
    newDateTime.hAlign = 0
    newDateTime.spaceAfter = 20
    elements.append(newDateTime)

    # Barre Horizontale
    elements.append(barreHorizontale)

    # ABANDON PRESTATION
    abandonPresta_data = [
        [empty_checkbox, "A ABANDONNE EN COURS DE PRESTATION A LA DATE DU:"],
        [None, "Indiquer le motif:"],
    ]
    abandonPresta_style = TableStyle(
        [
            ("FONTSIZE", (1, 0), (1, 0), grandePolice),
            ("VALIGN", (1, 0), (1, 0), "TOP"),
            ("FONTSIZE", (1, 1), (1, 1), basePolice),
        ]
    )
    abandonPresta = Table(abandonPresta_data, style=abandonPresta_style)
    abandonPresta.hAlign = 0
    abandonPresta.spaceAfter = 20
    elements.append(abandonPresta)

    # Barre Horizontale
    elements.append(barreHorizontale)

    # DISCLAIMER
    disclaimer_style = styles.getSampleStyleSheet()["Normal"]
    disclaimer_style.textColor = colors.grey
    disclaimer_style.fontSize = grandePolice
    disclaimer_style.alignment = enums.TA_CENTER
    disclaimer = Paragraph(
        "<strong>LES EVENEMENTS DOIVENT ETRE SIGNALES A LA PLATEFORME DES QUE POSSIBLE ET AU PLUS TARD DANS LES 48 HEURES -  01 49 44 42 86<strong>",
        disclaimer_style,
    )
    elements.append(disclaimer)

    # Write the document to disk
    doc.build(elements)
Пример #8
0
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
    elements.append(demarragePresta)
    
    # REFUS PRESTATION
    refusComments = "blablabla"
    refusPresta_data = [[checked_checkbox, "N'A PAS ADHERE A LA PRESTATION"],
                        [None, "Indiquer le motif: "+refusComments],
                        ]
    refusPresta_style = TableStyle([('FONTSIZE', (1,0), (1,0), grandePolice),
                                    ('VALIGN',(1,0),(1,0),'TOP'),
                                    ('FONTSIZE', (1,1), (1,1), petitePolice),
                                    ])
    refusPresta = Table(refusPresta_data, style=refusPresta_style)
    refusPresta.hAlign = 0
    refusPresta.spaceAfter = 10 
    elements.append(refusPresta)
    
    
    # ABSENT 
    absentPresta_data = [[empty_checkbox, "NE S'EST PAS PRESENTE"],
                        ]
    absentPresta_style = TableStyle([('FONTSIZE', (1,0), (1,0), grandePolice),
                                     ('VALIGN',(1,0),(1,0),'TOP'),
                                    ])
    absentPresta = Table(absentPresta_data, style=absentPresta_style)
    absentPresta.hAlign = 0
    absentPresta.spaceAfter = 10 
    elements.append(absentPresta)
    
    
    # REPORT 
    reportPresta_data = [[empty_checkbox, "A DEMANDEE AU PRESTATAIRE UN REPORT DU PREMIER RDV"],
                         [None,  "(8 jours maxi)"],
                        ]
    reportPresta_style = TableStyle([('FONTSIZE', (1,0), (1,0), grandePolice),
                                     ('FONTSIZE', (1,1), (1,1), basePolice),
                                     ('VALIGN',(1,0),(1,0),'TOP'),
                                    ])
    reportPresta = Table(reportPresta_data, style=reportPresta_style)
    reportPresta.hAlign = 0
    reportPresta.spaceAfter = 10 
    elements.append(reportPresta)
    
    newDateTime_data = [[None, "Date du nouveau RDV:", "Heure du nouveau RDV:"],
                        ]
    newDateTime_style = TableStyle([('FONTSIZE', (0,0), (-1,-1), basePolice),
                                    ])
    newDateTime = Table(newDateTime_data, style=newDateTime_style)
    newDateTime.hAlign = 0
    newDateTime.spaceAfter = 20
    elements.append(newDateTime)
    
    # Barre Horizontale
    elements.append(barreHorizontale)
    
    # ABANDON PRESTATION
    abandonPresta_data = [[empty_checkbox, "A ABANDONNE EN COURS DE PRESTATION A LA DATE DU:"],
                          [None, "Indiquer le motif:" ]
                          ]
    abandonPresta_style = TableStyle([('FONTSIZE', (1,0), (1,0), grandePolice),
                                      ('VALIGN',(1,0),(1,0),'TOP'),
                                      ('FONTSIZE', (1,1), (1,1), basePolice),
                                      ])
    abandonPresta = Table(abandonPresta_data, style=abandonPresta_style)
    abandonPresta.hAlign = 0
    abandonPresta.spaceAfter = 20
    elements.append(abandonPresta)
    
    # Barre Horizontale
    elements.append(barreHorizontale)
    
    
    #DISCLAIMER
    disclaimer_style = styles.getSampleStyleSheet()['Normal']
    disclaimer_style.textColor = colors.grey
    disclaimer_style.fontSize = grandePolice
    disclaimer_style.alignment = enums.TA_CENTER
    disclaimer = Paragraph("<strong>LES EVENEMENTS DOIVENT ETRE SIGNALES A LA PLATEFORME DES QUE POSSIBLE ET AU PLUS TARD DANS LES 48 HEURES -  01 49 44 42 86<strong>", disclaimer_style)
    elements.append(disclaimer)
    
    # Write the document to disk
    doc.build(elements)