Script Report : Adding columns doesn't reflect

Hello,

While creating Script Report defined some columns in report.py file…working fine…

But after adding new columns in same array (get_columns() method). doesn’t reflect in output.

what can be wrong here? Reloaded the page several times…

Is there any cache issue or something?.. how to solve it??

Thanks…

If there is an error in .py , it may continue showing previous columns…
can try to run execute from bench console… that will show if any errors in py file…
bench console

from myapp.dotted_path_to_report import execute
execute(filters={"a":"xyz"})

if py is correct it should return columns and data in console

on bench console,

How can I write python code, as you mentioned…Please explain

++++
from myapp.dotted_path_to_report import execute
execute(filters={“a”:“xyz”})

e.g. “Script Report” in accommodation/accommodation/report/internal_voucher/internal_voucher
execute method returns columns, data

def execute(filters=None):
    columns = get_columns(filters)
    data = get_data(filters)
    return columns, data

In a terminal start IPython with

bench console

running execute from console returns results as below

1 Like

To directly check in terminal without entering IPython, can call any function using bench execute with the dotted_path_to_function with args

frappe@box:~/sns-bench$ bench execute accommodation.accommodation.controller.email_all_internal_invoices --args "['Abacus', 'February']"

how to pass object in argument (eg. filters)?

1 Like

If you mean in code, check query_report.py

def run(report_name, filters=None, user=None):