class band_page_footer(ReportBand): height = 1.3 * cm elements = [ Label(text='¿Qué le ha parecido el servicio?', top=0.1 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 10, 'alignment': TA_CENTER }), Label( text= '( ) Malo ( ) Bueno ( ) Muy bueno', top=0.8 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica', 'fontSize': 10, 'alignment': TA_CENTER }), ] borders = {'top': True}
class band_detail(ReportBand): height = 400 * mm # Height bigger than a page, so a new page is launched for listings # auto_expand_height = True elements = ( Label(text=_('Distinct users by pool'), top=0.6 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 10, 'alignment': TA_CENTER }), UDSImage(left=4 * cm, top=1 * cm, width=GERALDO_WIDTH, height=GERALDO_HEIGHT, get_image=lambda x: x.instance['image']), Label(text=_('Accesses by pool'), top=GERALDO_HEIGHT + 1.2 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 10, 'alignment': TA_CENTER }), UDSImage(left=4 * cm, top=GERALDO_HEIGHT + 1.6 * cm, width=GERALDO_WIDTH, height=GERALDO_HEIGHT, get_image=lambda x: x.instance['image2']), )
class UsersReport(UDSGeraldoReport): title = '' author = 'UDS' header_elements = [ Label(text=_('Access Datetime'), top=2.0 * cm, left=0.5 * cm), Label(text=_('User'), top=2.0 * cm, left=5.5 * cm), Label(text=_('Duration(seconds)'), top=2.0 * cm, left=12 * cm), ] header_height = 2.5 * cm class band_detail(ReportBand): height = 0.5 * cm elements = ( ObjectValue(attribute_name='date', left=0.5 * cm, style={ 'fontName': 'Helvetica', 'fontSize': 8 }), ObjectValue(attribute_name='name', left=5.5 * cm, style={ 'fontName': 'Helvetica', 'fontSize': 8 }), ObjectValue(attribute_name='time', left=12 * cm, style={ 'fontName': 'Helvetica', 'fontSize': 8 }), )
class band_page_header(ReportBand): height = 2.0 * cm elements = [ SystemField(expression='%(report_title)s', top=0.5 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 14, 'alignment': TA_CENTER }), Label(text=_('User ID'), top=1.5 * cm, left=0.5 * cm), Label(text=_('Real Name'), top=1.5 * cm, left=6 * cm), Label(text=_('Last access'), top=1.5 * cm, left=15 * cm), SystemField(expression=_('Page %(page_number)d of %(page_count)d'), top=0.1 * cm, width=BAND_WIDTH, style={'alignment': TA_RIGHT}), Image(filename=stock.getStockImagePath(stock.LOGO), left=0.1 * cm, top=0.0 * cm, width=2 * cm, height=2 * cm), ] borders = {'bottom': True}
class SubReport_StavkeRacuna(SubReport): def get_queryset(self, subrepo, racun): return racun.stavkaracuna_set.all().order_by('rbr') band_detail = ReportBand(height=0.7 * cm, additional_fonts={'Segoe UI': SEGOE_UI}, default_style={ 'fontName': 'Segoe UI', 'fontSize': 12 }, elements=[ ObjectValue(attribute_name='rbr', top=6.7 * cm, left=0.2 * cm, width=17 * cm, style={'alignment': TA_LEFT}), ObjectValue( attribute_name='naziv_artikla', top=6.7 * cm, left=1.5 * cm, ), ObjectValue(attribute_name='cijena_artikla', top=6.7 * cm, left=6 * cm, width=2 * cm, style={'alignment': TA_RIGHT}), Label( text='kn', top=6.7 * cm, left=8.3 * cm, ), ObjectValue( attribute_name='kolicina', top=6.7 * cm, left=10.5 * cm, ), ObjectValue(attribute_name='ukupno', top=6.7 * cm, width=16.5 * cm, style={'alignment': TA_RIGHT}), Label(text='kn', top=6.7 * cm, width=17 * cm, style={'alignment': TA_RIGHT}), Line( top=6.6 * cm, left=0.0 * cm, right=17 * cm, bottom=6.6 * cm, stroke_width=0.8, ), ]) band_footer = ReportBand(elements=[ ObjectValue( get_value=lambda x: 'Ukupno {x.ukupni_iznos} kn'.format(x=x), top=6.7 * cm, width=17 * cm, style={'alignment': TA_RIGHT}), ])
class band_page_header(ReportBand): height = 4.2 * cm label_top = 3.7 * cm default_style = {'fontName': 'Helvetica', 'fontSize': 9} BASE_DIR = os.path.abspath(os.path.dirname(__file__) + '../../../../') #BASE_DIR = os.path.abspath(os.getcwd() + '../..') elements = [ Image( filename=BASE_DIR + static('img/logo-interlegis.jpg'), left=15.5 * cm, right=1 * cm, top=0.1 * cm, bottom=1 * cm, width=4.2 * cm, height=3 * cm, ), Image( filename=BASE_DIR + static('img/logo-senado.png'), left=1 * cm, right=1 * cm, top=0.1 * cm, bottom=1 * cm, width=3 * cm, height=3 * cm, ), Label(text=_(u"SENADO FEDERAL"), top=1 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 14, 'alignment': TA_CENTER }), Label(text=_(u"SINTER - Secretaria Especial do Interlegis"), top=1.5 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 13, 'alignment': TA_CENTER }), SystemField(expression='%(report_title)s', top=2.5 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 14, 'alignment': TA_CENTER }), ] borders = {'bottom': True}
class band_page_header(ReportBand): height = 1.3*cm elements = [ SystemField(expression='%(report_title)s', top=0.1*cm, left=0, width=BAND_WIDTH, style={'fontName': 'Helvetica-Bold', 'fontSize': 14, 'alignment': TA_CENTER}), Label(text="Hostname", top=0.8*cm, left=0.5*cm), Label(text=u"Rack", top=0.8*cm, left=3*cm), SystemField(expression=u'Page %(page_number)d of %(page_count)d', top=0.1*cm, width=BAND_WIDTH, style={'alignment': TA_RIGHT}), ] borders = {'bottom': True}
class band_summary(ReportBand): height = 0.8 * cm elements = [ SystemField(expression=u'----------------------------------------------------------------------------------------------------------------------------------------------------------------', top=0.1*cm, width=BAND_WIDTH), Label(text="Lucro", top=0.5*cm,style={'fontName': 'Helvetica-Bold'}, left=0.5*cm), ObjectValue(attribute_name='valorCobrado', top=0.5*cm, left=4*cm,\ action=FIELD_ACTION_SUM), Label(text="Gastos", top=1*cm, style={'fontName': 'Helvetica-Bold'},left=0.5*cm), ObjectValue(attribute_name='valorGasto', top=1*cm, left=4*cm,\ action=FIELD_ACTION_SUM), ]
class band_summary(ReportBand): height = 1.5*cm elements = [ ObjectValue(attribute_name='get_full_alumno' , top= 0*cm,left=2*cm,style={'fontName': 'Helvetica-Bold', 'fontSize':8, 'alignment': TA_LEFT}), ObjectValue(attribute_name='alumno.cve_usuario.get_full_name' , top= 0*cm,left=7.5*cm,style={'fontName': 'Helvetica-Bold', 'fontSize':8, 'alignment': TA_LEFT}), Label(text='Plan de estudios: 09', top=0*cm, left=13*cm, style={'fontName': 'Helvetica-bold', 'fontSize':8}), Label(text='Licenciatura en: Ingeniería en sistemas computacionales', top=0.5*cm, left=2*cm, width=9*cm, style={'fontName': 'Helvetica-bold', 'fontSize':8}), Label(text='Último grupo: ', top=0.5*cm, left=13*cm, style={'fontName': 'Helvetica-bold', 'fontSize':8}), #ObjectValue(attribute_name='materia',top=0.5*cm, left=15*cm, style={'fontName': 'Helvetica-bold', 'fontSize':8}), ] borders = {'bottom': Line(stroke_width=2)}
class AccessReport(UDSGeraldoReport): header_elements = [] class band_detail(ReportBand): height = 400 * mm # Height bigger than a page, so a new page is launched # auto_expand_height = True elements = ( Label(text=_('Users access by date'), top=0.6 * cm, left=0, width=BAND_WIDTH, style={'fontName': 'Helvetica-Bold', 'fontSize': 10, 'alignment': TA_CENTER}), UDSImage(left=4 * cm, top=1 * cm, width=GERALDO_WIDTH, height=GERALDO_HEIGHT, get_image=lambda x: x.instance['image']), Label(text=_('Users access by day of week'), top=GERALDO_HEIGHT + 1.2 * cm, left=0, width=BAND_WIDTH, style={'fontName': 'Helvetica-Bold', 'fontSize': 10, 'alignment': TA_CENTER}), UDSImage(left=4 * cm, top=GERALDO_HEIGHT + 1.6 * cm, width=GERALDO_WIDTH, height=GERALDO_HEIGHT, get_image=lambda x: x.instance['image2']), Label(text=_('Users access by hour'), top=2 * GERALDO_HEIGHT + 2 * cm, left=0, width=BAND_WIDTH, style={'fontName': 'Helvetica-Bold', 'fontSize': 10, 'alignment': TA_CENTER}), UDSImage(left=4 * cm, top=2 * GERALDO_HEIGHT + 2.4 * cm, width=GERALDO_WIDTH, height=GERALDO_HEIGHT, get_image=lambda x: x.instance['image3']), ) subreports = [ SubReport( queryset_string='%(object)s["data"]', band_header=ReportBand( height=1 * cm, auto_expand_height=True, elements=( Label(text=_('Users access by date'), top=0.2 * cm, left=0, width=BAND_WIDTH, style={'fontName': 'Helvetica-Bold', 'fontSize': 12, 'alignment': TA_CENTER}), Label(text=_('Date range'), top=1.0 * cm, left=1.2 * cm, style={'fontName': 'Helvetica-Bold', 'fontSize': 10}), Label(text=_('Users'), top=1.0 * cm, left=14 * cm, style={'fontName': 'Helvetica-Bold', 'fontSize': 10}), ), # borders={'bottom': True} ), band_detail=ReportBand( height=0.5 * cm, elements=( ObjectValue(attribute_name='date', top=0, left=1.2 * cm, width=12 * cm, style={'fontName': 'Helvetica', 'fontSize': 9}), ObjectValue(attribute_name='users', top=0, left=14 * cm, style={'fontName': 'Helvetica', 'fontSize': 9}), ) ), ) ]
class band_page_header(ReportBand): height = 2.0*cm elements = [ SystemField(expression='%(report_title)s', top=0.7*cm, left=0, width=BAND_WIDTH, style={'fontName': 'Helvetica-Bold', 'fontSize': 10, 'alignment': TA_CENTER}), Label(text="Acc Name", top=1.6*cm, left=1.3*cm), Label(text="Acc Code", top=1.6*cm, left=14*cm), #Label(text=u"Creation Date", top=1.6*cm, left=17*cm), SystemField(expression=u'Page %(page_number)d of %(page_count)d', top=0.1*cm, width=BAND_WIDTH, style={'alignment': TA_RIGHT}), SystemField(expression='Ruffwall Company', top=0.1*cm,left=0, width=BAND_WIDTH, style={'fontName': 'Helvetica-Bold','fontSize': 14,'alignment': TA_CENTER}), ] borders = {'bottom': True}
class band_begin(ReportBand): height = 1 * cm elements = [ Label(text='Look those permissions please', top=0.1 * cm, left=8 * cm), ]
class band_summary(ReportBand): height = 1.5 * cm elements = [ Label(text='Horario de clases', top=0.1 * cm, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 10, 'alignment': TA_CENTER }), ObjectValue(attribute_name='get_full_alumno', top=0 * cm, left=0, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 8, 'alignment': TA_LEFT }), ObjectValue(attribute_name='alumno.cve_usuario.get_full_name', top=0.4 * cm, left=0, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 8, 'alignment': TA_LEFT }), ]
class band_summary(ReportBand): height = 0.5 * cm elements = [ Label(text='Totals:', top=1.5 * cm), ObjectValue(expression='count(placa)', top=1.5 * cm, left=5 * cm), ] borders = {'top': True}
class band_page_header(ReportBand): height = 1.3 * cm elements = [ Image( top=0.1 * cm, left=0, width=2.0 * cm, height=2.0 * cm, filename=os.path.join( RUTA, '../PTACOCOMET/static/SysWeb/ACOCOMET-rpthumbnail.PNG'), ), SystemField(expression='%(report_title)s', top=0.1 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 14, 'alignment': TA_CENTER }), Label(text='Cooperatíva Financiera Única', top=0.8 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 10, 'alignment': TA_CENTER }), ] borders = {'bottom': True}
class band_page_footer(ReportBand): height = 0.5*cm elements = [ Label(text='Copyright Ruffwal', top=0.5*cm), SystemField(expression=u'Printed in %(now:%Y, %b %d)s at %(now:%H:%M)s', top=0.5*cm, width=BAND_WIDTH, style={'alignment': TA_RIGHT}), ]
class band_begin(ReportBand): height = 1*cm elements = [ Label(text='Información del alumno ', top=0.5*cm,left=5.8*cm,width=BAND_WIDTH, style={'fontName': 'Helvetica-Bold', 'fontSize': 14} ), ]
class band_page_footer(ReportBand): height = 0.5 * cm elements = [ Label(text='GAC', top=0.1 * cm), ] borders = {'top': True}
class band_detail(DetailBand): height = 0.7 * cm elements = [ Label(text='Name'), ObjectValue(expression='name', left=1.5 * cm), ] borders = {'bottom': True}
class band_page_header(ReportBand): height = 1.5 * cm elements = [ Image(left=0.4 * cm, top=0, width=4 * cm, height=5.12 * cm, filename=os.path.join(RUTA_PROYECTO, '../control/escom.gif')), SystemField(expression='%(report_title)s', top=0.1 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 21, 'alignment': TA_CENTER }), Label(text="Escuela Superior de Cómputo", top=0.8 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 16, 'alignment': TA_CENTER }), SystemField(expression=u'Pagina %(page_number)d de %(page_count)d', top=0.1 * cm, width=BAND_WIDTH, style={'alignment': TA_RIGHT}), ] borders = {'bottom': Line(stroke_width=5)}
class band_page_footer(ReportBand): height = 0.5*cm elements = [ Label(text='Documento sin validez oficial', top=0.1*cm), SystemField(expression=u'Fecha Elaboracion %(now:%Y, %b %d)s', top=0.1*cm, width=BAND_WIDTH, style={'alignment': TA_RIGHT}), ]
class band_begin(ReportBand): height = 1 * cm elements = [ Label(text="This is a <b>users</b> report.<br/>This time <i>our idea</i> is to show"+\ "some <font color=red>other features</font> of this reports engine", top=0.1*cm, left=0.1*cm, width=BAND_WIDTH), ] borders = {'all': True}
class band_page_footer(ReportBand): height = 0.5*cm elements = [ Label(text="%s" % request.utcnow.date(), top=0.1*cm, left=0), SystemField(expression="Page # %(page_number)d of %(page_count)d", top=0.1*cm, width=BAND_WIDTH, style={"alignment": TA_RIGHT}), ] borders = {"top": True}
class band_page_footer(ReportBand): height = 0.5*cm elements = [ Label(text='Geraldo Reports', top=0.1*cm), SystemField(expression=u'Printed in %(now:%Y, %b %d)s at %(now:%H:%M)s', top=0.1*cm, width=BAND_WIDTH, style={'alignment': TA_RIGHT}), ] borders = {'top': True}
class band_summary(ReportBand): height = 0.8 * cm elements = [ Label(text="Total general:", top=0.1*cm, left=0), ObjectValue(attribute_name='id', top=0.1*cm, left=2.5*cm,\ action=FIELD_ACTION_COUNT, display_format='%s '), ] borders = {'all': True}
class CountersPoolsReport(UDSGeraldoReport): title = '' author = 'UDS' header_elements = [] header_height = 2.5 * cm class band_detail(ReportBand): height = 400 * mm # Height bigger than a page, so a new page is launched for listings elements = ( Label(text=_('Services Asignation'), top=0.6 * cm, left=0, width=BAND_WIDTH, style={'fontName': 'Helvetica-Bold', 'fontSize': 10, 'alignment': TA_CENTER}), UDSImage(left=4 * cm, top=1 * cm, width=GERALDO_WIDTH, height=GERALDO_HEIGHT, get_image=lambda x: x.instance['image']), ) subreports = [ SubReport( queryset_string='%(object)s["data"]', band_header=ReportBand( height=1 * cm, auto_expand_height=True, elements=( Label(text=_('Service asignation by hour'), top=0.2 * cm, left=0, width=BAND_WIDTH, style={'fontName': 'Helvetica-Bold', 'fontSize': 12, 'alignment': TA_CENTER}), Label(text=_('Pool'), top=1.0 * cm, left=1.2 * cm, style={'fontName': 'Helvetica-Bold', 'fontSize': 10}), Label(text=_('Hour'), top=1.0 * cm, left=10 * cm, style={'fontName': 'Helvetica-Bold', 'fontSize': 10}), Label(text=_('Services'), top=1.0 * cm, left=14 * cm, style={'fontName': 'Helvetica-Bold', 'fontSize': 10}), ), # borders={'bottom': True} ), band_detail=ReportBand( height=0.5 * cm, elements=( ObjectValue(attribute_name='name', top=0, left=1.2 * cm, width=8.8 * cm, style={'fontName': 'Helvetica', 'fontSize': 9}), ObjectValue(attribute_name='time', top=0, left=10 * cm, width=4 * cm, style={'fontName': 'Helvetica', 'fontSize': 9}), ObjectValue(attribute_name='value', top=0, left=14 * cm, width=4 * cm, style={'fontName': 'Helvetica', 'fontSize': 9}), ) ), ) ]
class band_page_header(ReportDefault.band_page_header): label_top = ReportDefault.band_page_header.label_top label_left = [0, 1.5, 7, 9, 11, 13, 15, 17] elements = list(ReportDefault.band_page_header.elements) height = 4.7 * cm elements += [ Label( text=_(u"UF"), left=label_left[0] * cm, top=label_top + 0.4 * cm, ), Label( text=_(u"Municipio"), left=label_left[1] * cm, top=label_top + 0.4 * cm, ), Label( text=_(u"Data de Adesão"), left=label_left[2] * cm, top=label_top, width=2 * cm, ), Label( text=_(u"Número do Convênio"), left=label_left[3] * cm, top=label_top, width=2 * cm, ), Label( text=_(u"Data do Convênio"), left=label_left[4] * cm, top=label_top, width=2 * cm, ), Label( text=_(u"Data de Publicação"), left=label_left[5] * cm, top=label_top, width=2 * cm, ), Label( text=_(u"Data de Aceite"), left=label_left[6] * cm, top=label_top, width=2 * cm, ), Label( text=_(u"Projeto"), left=label_left[7] * cm, top=label_top + 0.4 * cm, width=2 * cm, ), ]
class band_detail(ReportBand): height = 400 * mm # Height bigger than a page, so a new page is launched for listings elements = ( Label(text=_('Services Asignation'), top=0.6 * cm, left=0, width=BAND_WIDTH, style={'fontName': 'Helvetica-Bold', 'fontSize': 10, 'alignment': TA_CENTER}), UDSImage(left=4 * cm, top=1 * cm, width=GERALDO_WIDTH, height=GERALDO_HEIGHT, get_image=lambda x: x.instance['image']), )
class band_page_header(ReportBand): height = 1.3 * cm elements = [ SystemField(expression='%(report_title)s', top=0.1 * cm, left=0, width=BAND_WIDTH, style={ 'fontName': 'Helvetica-Bold', 'fontSize': 14, 'alignment': TA_CENTER }), Label(text="ID", top=0.8 * cm, left=0), Label(text="Name", top=0.8 * cm, left=3 * cm), Label(text="Longitude", top=0.8 * cm, left=6 * cm), Label(text="Latitude", top=0.8 * cm, left=9 * cm), Label(text="Number", top=0.8 * cm, left=12 * cm), ] borders = {'bottom': True}
class band_page_footer(ReportBand): height = 0.5 * cm elements = [ Label(text='Automatically Created by Tools from Map-Team Suntec !', top=0.1 * cm, left=0), Label(text='Confidential Document, DO NOT SPREAD !', top=0.1 * cm, width=BAND_WIDTH, style={ 'alignment': TA_CENTER, 'textColor': red }), SystemField(expression='Page %(page_number)d / %(page_count)d', top=0.1 * cm, width=BAND_WIDTH, style={'alignment': TA_RIGHT}), ] borders = {'top': True}