"natureza nos termos de legislação aplicável em vigor. Na " "vigência deste compromisso, o(a) estagiário(a) compromete-se a " "observar as normas de segurança bem como as instruções " "aplicáveis a terceiros."), ("A CONCEDENTE incluirá o(a) estagiário(a), em uma apólice de " "seguros de acidentes pessoais. Se solicitado pela Instituição de " "Ensino do(a) estagiário(a), a CONCEDENTE expedirá uma Declaração" "de Estágio."), ("5 - O(a) estagiário(a) deverá informar de imediato e por " "escrito à CONCEDENTE, qualquer fato que interrompa, suspenda ou " "cancele sua matrícula na Instituição de Ensino interveniente, " "ficando ele responsável de quaisquer despesas causadas pela " "ausência dessa informação."), ("6 - E por estarem de comum acordo com as condições acima, " "firmam o presente compromisso em três vias de igual teor.")] self.create_extra_styles() map(lambda t: self.add_paragraph(t, style="JustifyParagraph"), contract_body) self.add_blank_space(20) self.add_paragraph("Data:", style="JustifyParagraph") self.add_blank_space(10) self.add_paragraph("Testemunhas:", style="JustifyParagraph") self.add_signatures(["Assinatura do(a) Estagiário(a)", "Responsável Legal"], height=20) self.add_signatures(["Responsável Legal", "Instituição de Ensino"]) filename = build_report(ContractExample) print_preview(filename)
self.add_blank_space() self.add_paragraph("<b>Notas:</b> %s" % client.notes) def get_rows(self, client): rows = [["Nome:", client.name, "Email:", client.email], ["Nascimento:", client.birth_date, "Sexo:", client.genre], ["Endereço:", client.address, "Cidade/Estado:", "%s/%s" % (client.city, client.state)]] return rows def add_basic_information_table(self, client): row = [["Data do Cadastro:", client.date], ["Endereço: ", client.address], ["", ""], ["Notas:", client.notes]] self.add_data_table(row) client = Settable(name="Oziel Fernandes da Silva", email="*****@*****.**", tel="3376-2309", birth_date="25/03/1976", genre="Masculino", address="Rua Alvares de Azevedo, N. 1283 Jd. Ipiranga", city="São Paulo", state="SP", notes="Sem notas") report_filename = build_report(ClientDetailsReport, client) print_preview(report_filename)
self.add_summary(objects) def add_summary(self, objects): self.add_paragraph('%d products listed.' % len(objects), style='Normal-AlignRight') values = [object.total_value for object in objects] total_value = reduce(operator.add, values, 0.0) total_value = '$ %.2f' % total_value self.add_data_table((('Total value:', total_value), ), align=RIGHT) def build_signatures(self): labels = ['Company manager', 'Purchase supervisor'] self.add_signatures(labels, align=CENTER) def get_objects(self): products = [] for data in open("csv/products.csv").readlines(): data = data.split("\t") quantity = float(data[0]) unit = data[1] description = data[2] price = float(data[3]) product = Product(quantity, unit, description, price) products.append(product) return products report_filename = build_report(PurchaseOrderReport) print_preview(report_filename)
from stoqlib.reporting.base.tables import (ObjectTableColumn as OTC, RIGHT) class ObjectTableColumnTest(ReportTemplate): report_name = "Simples teste com ObjectTableColumn" def __init__(self, filename, clients): ReportTemplate.__init__(self, filename, self.report_name) self.add_title("Relatório de Clientes") self.add_object_table(clients, self.get_cols()) def get_cols(self): return [OTC("Cod.", lambda obj: "%04d" % obj.id, width=80, align=RIGHT), OTC("Nome", lambda obj: obj.name, width=400)] class Client: def __init__(self, id, name): self.id, self.name = (id, name) client_list = [] for i in range(35): client = Client(i, "Nome do cliente #%d" % i) client_list.append(client) report_file = build_report(ObjectTableColumnTest, client_list) print_preview(report_file)
def get_cols(self): cols = [TC("Id", width=35), TC("Name", expand=True), TC("District", width=80), TC("City", width=80), TC("State", width=50), TC("Birth date", width=85)] return cols def get_rows(self): clients = [] for data in open('csv/clients.csv').readlines(): data = data.split("\t") id = int(data[0]) name = data[1] district = data[2] city = data[3] state = data[4] birth_date = data[5] columns = [id, name, district, city, state, birth_date] clients.append(columns) # Columns will be sorted by id clients.sort() return clients if __name__ == "__main__": report_filename = build_report(ClientsReport) print_preview(report_filename)
rows = self.get_rows() self.add_report_table(rows, header=header) self.add_paragraph('%d itens listed' % len(rows), style='Normal-AlignRight') def get_rows(self): production = [] for data in open('csv/vehicles_production.csv').readlines(): data = data.split("\t") id = data[0] description = data[1] type = data[2] measurement = data[3] start_measurement = data[4] end_measurement = data[5] total = data[6] difference = data[7] price = data[8] total_value = data[9] columns = [id, description, type, measurement, start_measurement, end_measurement, total, difference, price, total_value] production.append(columns) # Columns will be sorted by id production.sort() return production report_filename = build_report(VehiclesProductionReport) print_preview(report_filename)