Displaying serial number in .odt report

78 views
Skip to first unread message

Khurram Shahzad

unread,
May 11, 2017, 12:53:27 AM5/11/17
to tryton
Dear All,

I want to display serial numbers in every row of a table in an .odt report. Moreover, can any body help me find the documentation/manual for Relatorio Library used for report templating?

Regards,
Khurram.

Cédric Krier

unread,
May 11, 2017, 2:55:06 AM5/11/17
to tryton
On 2017-05-10 21:53, Khurram Shahzad wrote:
> Dear All,
>
> I want to display serial numbers in every row of a table in an .odt report.

You will have to modify every reports to add such field.

You may follow this to replace report template with a custom module:
http://doc.tryton.org/4.4/trytond/doc/topics/reports/index.html#replacing-existing-tryton-reports

Or you can just upload a new template from the administration menu of
the client.


> Moreover, can any body help me find the documentation/manual for Relatorio
> Library used for report templating?

You can find documentation at http://relatorio.readthedocs.org/

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Sergi Almacellas Abellana

unread,
May 11, 2017, 3:17:55 AM5/11/17
to try...@googlegroups.com
El 11/05/17 a les 06:53, Khurram Shahzad ha escrit:
The docs are here:

https://readthedocs.org/projects/relatorio/

Hope it helps.

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Khurram Shahzad

unread,
May 11, 2017, 3:59:50 AM5/11/17
to try...@googlegroups.com

Dear Cedric & Sergi,

Thanks for your kind responses.

In fact, I want to access the 'counter' attribute of the 'For Each' construct in order to populate 'Serial No.' column of a table:

S. No.

Item Description

Unit

Quantity

Unit Price

Total

<for each="line in purchase.lines">

?

<for each="line in line.description.split('\n')">

<line>

</for>

<line.unit.name>

<(format_number(line.quantity, purchase.party.lang, digits=line.unit_digits) + (line.unit and (' ' + line.unit.symbol) or '')) or ''>

<format_currency(line.unit_price, purchase.party.lang, purchase.currency)>

<format_currency(line.amount, purchase.party.lang, purchase.currency)>


What should I write in place of '?' under 'S. No.' column to display serial numbers (1, 2, 3 ...)?
 
Regards,
Khurram.

Sergi Almacellas Abellana

unread,
May 11, 2017, 4:08:11 AM5/11/17
to try...@googlegroups.com
El 11/05/17 a les 09:59, Khurram Shahzad ha escrit:
>
> Dear Cedric & Sergi,
>
> Thanks for your kind responses.
>
> In fact, I want to access the 'counter' attribute of the 'For Each'
> construct in order to populate 'Serial No.' column of a table:
Have you tried with enumerate?

<for each="idx, line in enumerate(purchase.lines)">

Where idx will contain the 'counter' and line the line object.

Hope it helps!

Khurram Shahzad

unread,
May 11, 2017, 6:11:54 AM5/11/17
to try...@googlegroups.com


On Thu, May 11, 2017 at 1:08 PM, Sergi Almacellas Abellana <se...@koolpi.com> wrote:
El 11/05/17 a les 09:59, Khurram Shahzad ha escrit:

Dear Cedric & Sergi,

Thanks for your kind responses.

In fact, I want to access the 'counter' attribute of the 'For Each'
construct in order to populate 'Serial No.' column of a table:
Have you tried with enumerate?

<for each="idx, line in enumerate(purchase.lines)">

Where idx will contain the 'counter' and line the line object.

Hope it helps!

Its working like a magic. Fantabulous! Thank you!
Reply all
Reply to author
Forward
0 new messages