Custom report print format

I’m trying to edit the html file of the report to create a custom template, but, I’m unable to use get_value, db.get_value and get_doc in it. All 3 throws error on console.

How can I fetch data from another doctype in this case. It doesn’t use Jinja but some other templating engine.

Please guide.

Hello,

You may also include the data on the report itself.

Regards,

Ivan

Are you by any chance using a script report or making a custom print format for a query or built-in report?

I’m trying to fetch customer address and adding it each row will increase its width. Any other way?

I using a script report, Accounts Receivable, to be precise.

Hello,

Found something, this is not the good way to do it. You can attach after_datatable_render script on report and modify the data of the query report like this.

frappe.query_reports["..."] = {
    "after_datatable_render": function(_) {
      frappe.query_report.data[0]['test'] = 'Testing';
    },
	"filters": [...]
}

Regards,

Ivan

1 Like