Generate report file output from a server module

13 views
Skip to first unread message

Moh. Sarip Hidayat

unread,
Nov 9, 2025, 5:36:16 AMNov 9
to Jam.py Users Mailing List
Hi everyone,

I would like to request a guidance on how to generate a pdf report file output from server module.

I have a reference client module code here:
    print_invoice_btn.click(function(){
        task.reports.order_invoice.id.value = item.order_id.lookup_value;
        task.reports.order_invoice.print();
    });

I need to do the same but only to generate the pdf file and getting the filename to be processed on subsequent steps.

When I tried something like this:
    item.task.order_invoice.id.value = order_id
    item.task.order_invoice.generate(item.task.order_invoice)

Following errors returned:
TypeError: generate() missing 2 required positional arguments: 'url' and 'ext'

I couldn't understand what that means and going through https://jam-py.com/docs/refs/server/report/m_generate.html doesn't help me in this case.

Some threads I have been looking at but it seems it still require the report generation to be triggered from the client module:

Please let me know if further details are needed.

Thank you.

Moh. Sarip Hidayat

unread,
Nov 9, 2025, 12:22:59 PMNov 9
to Jam.py Users Mailing List
Oh hey, I figured it out lol

    r = item.task.order_invoice.copy()
    r.generate([order_id], '', 'pdf')
    return r.report_filename

Thanks anyway, and I hope this helps someone else facing the same problem.
Reply all
Reply to author
Forward
0 new messages