V13-How to default the filter value in Query reports

I have the analysed the frappe framework on how the reports are being executed. frappe/query_report.py at develop · frappe/frappe · GitHub.
the code executes query in the query section with filter if it is a query report else runs with the script in the script section.
So when you choose the option as script report client script section will open.

Here is a little hack. Maybe this is a bug. For now i am using this bug to my favour.
You can define the filter here with default values in the client script section like below


save the report. Run the report once to get the filter value

now switch back the report type to query report.
now use the filters as usual. Note please don’t define the filters in the filter section.

4 Likes