Strange situation with report: python variables in text between them don't show

49 views
Skip to first unread message

Danijel Kaurin

unread,
Sep 13, 2022, 12:35:58 PM9/13/22
to Jam.py Users Mailing List
Hi Andrew.

I have strange issue with report so I modified customers_report from demo to simulate that. When I have more than one python variables in same row with text written in report template, variable values don't load.

In next row, variables have only && in the between and then load.

Situation 1:

report_1.PNG

Situation 2:

report_2.PNG

Reports code:

def on_generate(report):
    cust = report.task.customers.copy()
    cust.set_where(id=1)
    cust.open()

    report.print_band('title')
   
    firstname = cust.firstname.display_text
    country = cust.country.display_text
    phone = cust.phone.display_text
    report.print_band('test', locals())

Report template is in attachment.

Regards

Danijel Kaurin

customers.ods

Drazen D. Babic

unread,
Sep 13, 2022, 9:34:02 PM9/13/22
to Jam.py Users Mailing List
Just split the cells if that is acceptable. 
report_01.PNG
customers.ods

Drazen D. Babic

unread,
Sep 13, 2022, 9:45:44 PM9/13/22
to Jam.py Users Mailing List
customers_report_2022-09-14_09-43-35.178567.pdf
customers.ods

Drazen D. Babic

unread,
Sep 13, 2022, 11:51:03 PM9/13/22
to Jam.py Users Mailing List
And this are final docs. I see no issues.
customers.ods
customers_report_2022-09-14_11-48-24.149721.pdf

Danijel Kaurin

unread,
Sep 14, 2022, 12:33:24 PM9/14/22
to Drazen D. Babic, Jam.py Users Mailing List
Hi Dražen. 

I need to print all text in one row, not splited columns.

Regards

--
You received this message because you are subscribed to a topic in the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jam-py/ojd3l0VUJNQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jam-py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jam-py/ad79ad0e-703a-4f40-93e4-31a68136086bn%40googlegroups.com.

Manos Pappas

unread,
Sep 14, 2022, 2:00:20 PM9/14/22
to Jam.py Users Mailing List
Hi Danijel,

It seems that there is some kind of parse error with the way Jam understands text within a ODS column and a variable (which is still text but with special formatting).
I have not noticed the issue because all I use reports for are for invoice-like statements but I have a solution to your problem:
for columns that contain text together with more than one variables you can use the text concatenate operator within the text column to insert variables from other columns (they can be hidden).

Have a look at the attached .ods file, I think it will work for you.

Regards,
Manos
customers.ods

Drazen Babic

unread,
Sep 14, 2022, 8:15:08 PM9/14/22
to Jam.py Users Mailing List
Danijel,

you mean like this, correct? Firstone is split, the second one is not....
>> <https://groups.google.com/d/msgid/jam-py/ad79ad0e-703a-4f40-93e4-31a68136086bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
report_02.PNG

Drazen D. Babic

unread,
Sep 15, 2022, 3:07:59 AM9/15/22
to Jam.py Users Mailing List
The only way I could print is to place it like this:

report_05.PNG

It is a LibreOffice nuisance....
Reply all
Reply to author
Forward
0 new messages