Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to create custom sales report
 
erapp
Member
 
Total Posts:  31
Joined:  2010-03-29
 

Ok, I tried the Vendas sample in local and simply could not get it to show up at all.  So, I am now modifying core (but backing up constantly) and trying to get the Vendas example to work.  My hope is that once I get the report working and the demo up for the customer I can go back and get it working in local.

Unfortunately, when I select the Vendas report from the menu I get the following error:

Fatal error: Call to a member function getStoreIds() on a non-object in /web/sites/commonwealth.missiondata.net/html/magento/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php on line 80

This appears to be:

if ($this->getFilterData()->getStoreIds()) {
$this->setStoreIds(explode(’,’, $this->getFilterData()->getStoreIds()));

Any ideas?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
erapp
Member
 
Total Posts:  31
Joined:  2010-03-29
 

Ok, I caught one small error, but I still get the following error:

Fatal error: Call to a member function getStoreIds() on a non-object in /web/sites/commonwealth.missiondata.net/html/magento/app/code/core/Mage/Adminhtml/Block/Report/Sales/Vendas/Grid.php on line 80

Anybody?

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gaebarre
Jr. Member
 
Total Posts:  10
Joined:  2010-03-17
 

Erapp I’m having the same issue with Magento 1.4

Fatal error: Call to a member function getStoreIds() on a non-object in /app/code/core/Mage/Adminhtml/Block/Report/Sales/Vendas/Grid.php on line 79

Have you found a solution ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
erapp
Member
 
Total Posts:  31
Joined:  2010-03-29
 

gaebarre,

No.  I moved on and have worked on some other sample custom reports.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gaebarre
Jr. Member
 
Total Posts:  10
Joined:  2010-03-17
 

So did I

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jonathan123
Sr. Member
 
Total Posts:  215
Joined:  2008-09-14
 

Just wanted to check in to see if anyone has figured out how to (or even if you can) create a custom report in /local?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ronchuke
Jr. Member
 
Total Posts:  10
Joined:  2010-07-20
 

Hey,

Can you advise on the other sample custom reports?

 
Magento Community Magento Community
Magento Community
Magento Community
 
PeterA
Jr. Member
 
Total Posts:  10
Joined:  2009-01-25
 

Guys, I was in desperate need for something to speed this up so I bought this extension. Mate, easily the best thing I did. Give it a look, it most likly does what you guys are asking for. Custom Profit Loss Report

 
Magento Community Magento Community
Magento Community
Magento Community
 
Usman Zaheer
Jr. Member
 
Total Posts:  6
Joined:  2010-11-15
 

Was anyone here able to make it work? I am unable to

As far as the getStoreId issue is concerned, I believe its coming because of the line
->_addContent($this->getLayout()->createBlock(’adminhtml/report_sales_vendas’))

It should be
->_addContent($this->getLayout()->createBlock(’report_sales_vendas.grid’))

Anybody who was able to do can please let us know. Thanks a lot.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Usman Zaheer
Jr. Member
 
Total Posts:  6
Joined:  2010-11-15
 
jaggsr - 07 September 2009 12:46 AM

Hello Guys,
I would like to Thanks all to help here.
I was able to generate the custom report I was wanted.

I described here.
http://magentocoder.jigneshpatel.co.in/php/create-custom-reports-in-magento-admin/

Take a look at the attachment what I got.

Best,

I am unable to view this link.. it open but without any content.. was this moved to some place else? I badly need this

 
Magento Community Magento Community
Magento Community
Magento Community
 
cosmorodrigo
Jr. Member
 
Total Posts:  2
Joined:  2011-02-09
 

da uma olhada nesse link:http://www.cosmorodrigo.com.br/como-fazer-um-relatorio-customizado-para-magento/

Talvez possa te ajudar.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rattler72
Jr. Member
 
Avatar
Total Posts:  24
Joined:  2009-08-13
West Vancouver, BC Canada
 

I am also having some issues with

$this->getFilterData()
being null. I can’t find where the filter data is set, and the lack of documentation is not helping.
 
Magento Community Magento Community
Magento Community
Magento Community
 
sophiasstyle09
Member
 
Total Posts:  45
Joined:  2010-01-11
 

hello,

I’m having a similar issue.  The error I get on the custom report page (coming from report’s controller indexAction funciton.  Happens within the renderLayout function call).

Fatal error: Call to a member function getData() on a non-object in .../html/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php on line 113

The non-object is filter data.  I would really appreciate a point in the right direction.

My controller object extends Mage_Adminhtml_Report_SalesController
Block extends Mage_Adminhtml_Block_Widget_Grid_Container
Grid extends Mage_Adminhtml_Block_Report_Grid_Abstract
and I have a custom filter from that extends Mage_Adminhtml_Block_Widget_Form

I created a layout file and a model file that extends Mage_Reports_Model_Mysql4_Order_Collection - but I haven’t really done anything this than copy something from a tutorial as I don’t think that’s the step I"m on yet.  I need to figure out how to use the Form built in the UI.

I’m feeling very lost and don’t know if I’m on the right path. If you know of any tips or a good tutorial it would be really appreciated.

Thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
 
manan25386
Jr. Member
 
Total Posts:  1
Joined:  2011-03-30
 

Add this code in Sales.xml and you get the report (/app/design/adminhtml/default/default/layout/) add the following code right after the

<adminhtml_report_sales_sales>

section.

<adminhtml_report_sales_xg>
<update handle="report_sales"/>
<reference name="content">
<block type="adminhtml/report_sales_xg" template="report/grid/container.phtml" name="sales.report.grid.container">
<block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
<action method="setStoreVarName"><var_name>store_ids</var_name></action>
</block>
<block type="sales/adminhtml_report_filter_form_order" name="grid.filter.form">
<action method="addReportTypeOption" translate="value">
<key>created_at_order</key>
<value>Order Created Date</value>
</action>
<action method="addReportTypeOption" translate="value">
<key>updated_at_order</key>
<value>Order Updated Date</value>
</action>
<action method="setFieldOption" translate="value">
<field>report_type</field>
<option>note</option>
<value>Order Updated Date report is real-time, does not need statistics refreshing.</value>
</action>
</block>
</block>
</reference>
</adminhtml_report_sales_xg>

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vad_svk
Jr. Member
 
Total Posts:  5
Joined:  2011-12-22
 

Hi all!
I\’m having the same problem with $this->getFilterData(). It returns null instead of Varien_Object.

The answer from member manan25386 looks helpful but I’m creating my own module and it works with sales_recurring_profiles table, so the XML-code he provided is not so easy fo me to use. I don\’t know what is the key points in that code I have to change to make it work for me.

Here goes my XML:

<?xml version=\"1.0\"?>
<layout version=\"0.1.0\">
<
profilesreport_adminhtml_profilesreport_index>
        <
update handle=\"profilesreport\"/>
        <
reference name=\"content\">
            <
block type=\"profilesreport/adminhtml_profilesreport\" template=\"MyCompanyName/profilesreport.phtml\" name=\"profilesreport.report.grid.container\">
                <
block type=\"profilesreport/adminhtml_profilesreport_filter\" name=\"grid.filter.form\">
                    <
action method=\"addReportTypeOption\" translate=\"value\">
                        <
key>created_at_order</key>
                        <
value>Order Created Date</value>
                    </
action>
                    <
action method=\"addReportTypeOption\" translate=\"value\">
                        <
key>updated_at_order</key>
                        <
value>Order Updated Date</value>
                    </
action>
                    <
action method=\"setFieldOption\" translate=\"value\">
                        <
field>report_type</field>
                        <
option>note</option>
                        <
value>Order Updated Date report is real-timedoes not need statistics refreshing.</value>
                    </
action>
                </
block>
            </
block>
        </
reference>
    </
profilesreport_adminhtml_profilesreport_index>
</
layout>

I didn’t made any changes for the code inside the block \"<block type=\"profilesreport/adminhtml_profilesreport_filter\" name=\"grid.filter.form\">\" because I think the problem is located here: <update handle=\"profilesreport\"/>
I have no idea what I should write in \"handle\" key. Can anybody help?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top