In Adminhtml/Block/Report/Sales/Sales/Grid.php I want the grid to have a second criteria that it will be grouped by. So for example if there was a vender name that was associated with a product and the user chose a period of month and selected 开发者_运维技巧a checkbox to break down by vendor, the report would be like this
Period | Vendor | Orders | ...
7/2011 | Vendor 1 | 10 | ... 8/2011 | Vendor 2 | 15 | ...Would I add another period through $collection->setPeriod('vendor')?
there should be a method in that file called _prepareColumns. In that method is where you would add another column.
$this->addColumn('vendor', array(
'header' => Mage::helper('sales')->__('Vendor'),
'index' => 'vendor',
'width' => 100,
'sortable' => true,
));
Next you need to make sure that the "vendor" field is in data returned to the grid.
精彩评论