Задать вопрос

Тел: +7 965 3737 888

465

Просмотров

1

Ответов

Widget for DateTime values on Geraldo Reports

<p>This is a widget for date/time fields on <strong>Geraldo Reports</strong>.</p>
<p>When you use Geraldo to write reports, date/time fields must be formatted using <strong>get_value</strong> lambda attribute, because ObjectValue doesn't know what mask you want to use.</p>
<p>With this widget, you just copy it into a common use Python file, import into your reports file and use it replacing ObjectValue on elements for fields you must be formatted as date/time format.</p>
<p><strong>Example:</strong></p>
from geraldo import Report, ReportBand, ObjectValue, landscape
from utils.reports import DateTimeObjectValue

class ReportPhoneList(Report):
    title = u'Phone List'
    page_size = landscape(A4)

    class band_detail(ReportBand):
        height = 0.5*cm
        elements = [
            ObjectValue(attribute_name='id', top=0.1*cm),
            DateTimeObjectValue(attribute_name='birth_date',
                left=26.2*cm, top=0.1*cm, format='%m/%d/%Y'),
            ]

Вопрос полезен? Да0/Нет0
file_4668.py(291.0б)
None

Ответы (1):

Ответsurabhi:12.07.2012
Ответ полезен? Да0/Нет0

Hi All, Can anyone suggest how to rounded off a number to a near integer value in Geraldo reports. I am unable to do this and could not find any snippets as well. I am using Django with Geraldo report to print PDF reports.

If anyone provide quick response on this appreciated.

Thanks, Surabhi