From 658872c025674f41fcf6d1ec6fbe7517fa8013a9 Mon Sep 17 00:00:00 2001 From: "Starlone (Estagiario)" Date: Wed, 16 Mar 2011 18:48:08 +0000 Subject: [PATCH] =?UTF-8?q?Adicionando=20sum=C3=A1rio=20de=20total=20ao=20?= =?UTF-8?q?final=20do=20relatorio=20default=20sendo=20assim=20ser=C3=A1=20?= =?UTF-8?q?herdado=20para=20os=20demais.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/relatorios/reports.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sigi/apps/relatorios/reports.py b/sigi/apps/relatorios/reports.py index eca5252..3387356 100644 --- a/sigi/apps/relatorios/reports.py +++ b/sigi/apps/relatorios/reports.py @@ -3,11 +3,13 @@ import os from geraldo import Report, ReportBand, ObjectValue, DetailBand, Label, \ landscape,SystemField, BAND_WIDTH,ReportGroup, \ - FIELD_ACTION_SUM, FIELD_ACTION_COUNT + FIELD_ACTION_SUM, FIELD_ACTION_COUNT, Line from geraldo.graphics import Image from reportlab.lib.units import cm from reportlab.lib.pagesizes import A4 from reportlab.lib.enums import TA_CENTER, TA_RIGHT +from reportlab.lib.colors import navy, red + class ReportDefault(Report): #__metaclass__ = ABCMeta @@ -61,3 +63,14 @@ class ReportDefault(Report): height = 0.5*cm default_style = {'fontName': 'Helvetica', 'fontSize': 8} auto_expand_height = True + + class band_summary(ReportBand): + height = 0.8*cm + elements = [ + Label(text="Total:", top=0.1*cm, left=0), + ObjectValue(attribute_name='id', top=0.1*cm, left=2*cm,\ + action=FIELD_ACTION_COUNT, display_format='%s'), + ] + borders = {'top': Line(stroke_color=navy, stroke_width=2)} + +