user398314
user398314

Reputation: 367

magento custom admin report filter

I built a custom report pretty much following this guide http://www.summasolutions.net/blogposts/custom-reports-magento. However I also want the ability to add a filter; like the one located @ Report->Sales->Orders.

I have tried to figure out where all the necessary pieces located within core are but i must be missing something. They appear to be at Mage/Sales/Block/Adminhtml/Report/Filter/Form

Any help would be awesome

Upvotes: 1

Views: 4004

Answers (1)

ontek
ontek

Reputation: 584

Have a look at /app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php, and go to salesAction, you'll see two blocks referenced:

$gridBlock = $this->getLayout()->getBlock('report_sales_sales.grid');
$filterFormBlock = $this->getLayout()->getBlock('grid.filter.form');

Which you can find defined in app/design/adminhtml/default/default/layout/sales.xml, under the section marked <adminhtml_report_sales_sale>. Note there are some options set here through action methods. This directs you to sales/adminhtml_report_filter_form_order, which you can find at app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Order.php, and its parent, ../Form.php. Have a look at the _prepareForm() functions, that should give you a better template to work with. Note that both of these are descendants of Mage/Sales/Block/Adminhtml/Report/Filter/Form.

Upvotes: 1

Related Questions