Action button is working in "List View" but does not work in "Report View"

I added action to the menu using below script it while it is working in list view it does not work in report view, do I need to create it separately for report view, if so how do i do that?

frappe.listview_settings['Purchase Receipt'].onload = function(listview) {
    // add button to menu"Create Invoice"), function() {

Hi @akshay,

Please apply it.

frappe.listview_settings['Purchase Receipt'].refresh = function(listview) {"Create Invoice"), function() {
	   // add your code according.

Then reload and check it.

Thank You!

Thanks, It is working now.