|
|
@ -1,4 +1,4 @@ |
|
|
|
##parameters=sessao,imagem,data,lst_materias,dic_cabecalho,lst_rodape,dic_filtro |
|
|
|
# parameters=sessao,imagem,data,lst_materias,dic_cabecalho,lst_rodape,dic_filtro |
|
|
|
|
|
|
|
"""relatorio_materia.py |
|
|
|
External method para gerar o arquivo rml do resultado de uma pesquisa de matérias |
|
|
@ -14,26 +14,34 @@ from trml2pdf import parseString |
|
|
|
def cabecalho(dic_cabecalho, imagem): |
|
|
|
"""Gera o codigo rml do cabecalho""" |
|
|
|
tmp_data = '' |
|
|
|
tmp_data+='\t\t\t\t<image x="2.1cm" y="25.7cm" width="59" height="62" file="' + imagem + '"/>\n' |
|
|
|
tmp_data += '\t\t\t\t<image x="2.1cm" y="25.7cm" width="59" height="62" file="' + \ |
|
|
|
imagem + '"/>\n' |
|
|
|
tmp_data += '\t\t\t\t<lines>2cm 25cm 19cm 25cm</lines>\n' |
|
|
|
tmp_data += '\t\t\t\t<setFont name="Helvetica" size="18"/>\n' |
|
|
|
tmp_data+='\t\t\t\t<drawString x="5cm" y="27.2cm">' + dic_cabecalho['nom_casa'] + '</drawString>\n' |
|
|
|
tmp_data += '\t\t\t\t<drawString x="5cm" y="27.2cm">' + \ |
|
|
|
dic_cabecalho['nom_casa'] + '</drawString>\n' |
|
|
|
tmp_data += '\t\t\t\t<setFont name="Helvetica" size="16"/>\n' |
|
|
|
tmp_data+='\t\t\t\t<drawString x="07cm" y="26.5cm">' + dic_cabecalho['nom_estado'] + '</drawString>\n' |
|
|
|
tmp_data += '\t\t\t\t<drawString x="07cm" y="26.5cm">' + \ |
|
|
|
dic_cabecalho['nom_estado'] + '</drawString>\n' |
|
|
|
tmp_data += '\t\t\t\t<setFont name="Helvetica" size="15"/>\n' |
|
|
|
tmp_data += '\t\t\t\t<drawCentredString x="10.5cm" y="25.2cm">SECRETARIA</drawCentredString>\n' |
|
|
|
return tmp_data |
|
|
|
|
|
|
|
|
|
|
|
def rodape(lst_rodape): |
|
|
|
"""Gera o codigo rml do rodape""" |
|
|
|
tmp_data = '' |
|
|
|
tmp_data += '\t\t\t\t<lines>2cm 3.2cm 19cm 3.2cm</lines>\n' |
|
|
|
tmp_data += '\t\t\t\t<setFont name="Helvetica" size="8"/>\n' |
|
|
|
tmp_data+='\t\t\t\t<drawString x="2cm" y="3.3cm">' + lst_rodape[2] + '</drawString>\n' |
|
|
|
tmp_data+='\t\t\t\t<drawCentredString x="10.5cm" y="2.7cm">' + lst_rodape[0] + '</drawCentredString>\n' |
|
|
|
tmp_data+='\t\t\t\t<drawCentredString x="10.5cm" y="2.3cm">' + lst_rodape[1] + '</drawCentredString>\n' |
|
|
|
tmp_data += '\t\t\t\t<drawString x="2cm" y="3.3cm">' + \ |
|
|
|
lst_rodape[2] + '</drawString>\n' |
|
|
|
tmp_data += '\t\t\t\t<drawCentredString x="10.5cm" y="2.7cm">' + \ |
|
|
|
lst_rodape[0] + '</drawCentredString>\n' |
|
|
|
tmp_data += '\t\t\t\t<drawCentredString x="10.5cm" y="2.3cm">' + \ |
|
|
|
lst_rodape[1] + '</drawCentredString>\n' |
|
|
|
return tmp_data |
|
|
|
|
|
|
|
|
|
|
|
def paraStyle(): |
|
|
|
"""Gera o codigo rml que define o estilo dos paragrafos""" |
|
|
|
tmp_data = '' |
|
|
@ -50,6 +58,7 @@ def paraStyle(): |
|
|
|
tmp_data += '\t</stylesheet>\n' |
|
|
|
return tmp_data |
|
|
|
|
|
|
|
|
|
|
|
def materias(lst_materias): |
|
|
|
"""Gera o codigo rml do conteudo da pesquisa de materias""" |
|
|
|
|
|
|
@ -81,26 +90,30 @@ def materias(lst_materias): |
|
|
|
tmp_data += '\t\t<para style="P2">\n' |
|
|
|
tmp_data += '\t\t\t<font color="white"> </font>\n' |
|
|
|
tmp_data += '\t\t</para>\n' |
|
|
|
tmp_data+='\t\t<para style="P2"><b>INDICAÇÃO:</b> ' + dic['materia'] + '</para>\n' |
|
|
|
tmp_data += '\t\t<para style="P2"><b>INDICAÇÃO:</b> ' + \ |
|
|
|
dic['materia'] + '</para>\n' |
|
|
|
tmp_data += '\t\t<para style="P2">\n' |
|
|
|
tmp_data += '\t\t\t<font color="white"> </font>\n' |
|
|
|
tmp_data += '\t\t</para>\n' |
|
|
|
|
|
|
|
if dic['dat_apresentacao'] != None: |
|
|
|
tmp_data+='\t\t<para style="P2"><b>DATA DE ENTRADA:</b> ' + dic['dat_apresentacao'] + '</para>\n' |
|
|
|
tmp_data += '\t\t<para style="P2"><b>DATA DE ENTRADA:</b> ' + \ |
|
|
|
dic['dat_apresentacao'] + '</para>\n' |
|
|
|
tmp_data += '\t\t<para style="P2">\n' |
|
|
|
tmp_data += '\t\t\t<font color="white"> </font>\n' |
|
|
|
tmp_data += '\t\t</para>\n' |
|
|
|
|
|
|
|
if dic['nom_autor'] != None: |
|
|
|
tmp_data+='\t\t<para style="P2"><b>AUTOR:</b> ' + dic['nom_autor'] + '</para>\n' |
|
|
|
tmp_data += '\t\t<para style="P2"><b>AUTOR:</b> ' + \ |
|
|
|
dic['nom_autor'] + '</para>\n' |
|
|
|
tmp_data += '\t\t<para style="P2">\n' |
|
|
|
tmp_data += '\t\t\t<font color="white"> </font>\n' |
|
|
|
tmp_data += '\t\t</para>\n' |
|
|
|
|
|
|
|
if dic['txt_ementa'] != None: |
|
|
|
txt_ementa = dic['txt_ementa'].replace('&', '&') |
|
|
|
tmp_data+='\t\t<para style="P2"><b>EMENTA:</b> ' + dic['txt_ementa'] + '</para>\n' |
|
|
|
tmp_data += '\t\t<para style="P2"><b>EMENTA:</b> ' + \ |
|
|
|
dic['txt_ementa'] + '</para>\n' |
|
|
|
tmp_data += '\t\t<para style="P2">\n' |
|
|
|
tmp_data += '\t\t\t<font color="white"> </font>\n' |
|
|
|
tmp_data += '\t\t</para>\n' |
|
|
|