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

Тел: +7 965 3737 888

486

Просмотров

0

Ответов

Widget for Money values on Geraldo Reports

<p>This is a widget for decimal/money/currency fields on <strong>Geraldo Reports</strong>.</p>
<p>When you use Geraldo to write reports, decimal 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 money format.</p>
<p><strong>Example:</strong></p>
from geraldo import Report, ReportBand, ObjectValue
from utils.reports import DecimalObjectValue

class ReportCustomers(Report):
    title = u'Customers List'
    page_size = A4

    class band_detail(ReportBand):
        height = 0.5*cm
        elements = [
            ObjectValue(attribute_name='id', top=0.1*cm),
            DecimalObjectValue(attribute_name='salary',
                left=26.2*cm, top=0.1*cm, format='%0.03f'),
            ]

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