[development - script report] [solved] How to send addition information in script report from python to HTML template

I am developing a script report in version 12 to send statements to clients based on the general ledger report.

Currently, the execute function returns only columns and results

def execute(filters=None):
    return columns, res

I need to send additional information

def execute(filters=None):
    data_to_be_printed = get_customer_details(filters.party)
    return columns, res, None, None, data_to_be_printed

It appears as if the last parameter will appear as “data_to_be_printed”. The following posts allude to this.

The resulting JSON is indeed showing the field

         "data_to_be_printed": "Data 1",

In my html report, I tried to print, without success.
I even tried setting and accessing the variable as an array, but it appears I cannot access the “data_to_be_printed” in the HTML report.

[[ {%= this.data_to_be_printed %} ]]<br>
[[ {%= data_to_be_printed %} ]]<br>

Any ideas where I could be going wrong?

I hope you have find the answer you were looking for.

Well I have same scenario where I’m using the “data_to_be_printed” in response but the parameter is not getting print on page. Can you please guides me.

Hi, I have found an workaround, not sure whether it is a correct implementation or not.

{%= report.raw_data.data_to_be_printed %}

Can anyone please verify this implementation?


I can confirm this works. Thank you