I need to do exactly I asked in the question.
I have overrided the reports generation file app/code/core/Mage/Adminhtml/Adminhtml/Block/Report/Sales/Sales/Grid.php
to app/code/local/Mage/Adminhtml/Adminhtml/Block/Report/Sales/Sales/Grid.php
.
Now I want to print the query that is being generated but I am clueless when I see the ResourceModel
is set dynamically like below:
public function getResourceCollectionName()
{
return ($this->getFilterData()->getData('report_type') == 'updated_at_order')
? 'sales/report_order_updatedat_collection'
: 'sales/report_order_collection';
}
I modified this function like below but in vain:
public function getResourceCollectionName()
{
$resCollName = ($this->getFilterData()->getData('report_type') == 'updated_at_order')
? 'sales/report_order_updatedat_collection'
: 'sales/report_order_collection';
echo Mage::getResourceModel($resCollName)->getSelect();die;
return $resCollName;
}
How to print query generated in this function so I don't have to override the Abstract.php
file ?