magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Ordered Products (Products Sold) Report CSV / XML Export Broken #10992

Closed shamoon closed 6 years ago

shamoon commented 7 years ago

Preconditions

  1. Magento v2.19
  2. PHP 7 / MySQL 5.6

Steps to reproduce

  1. Go to Reports > Products > Ordered
  2. Choose Range and Show By: Year
  3. Hit Export to: CSV (or XML)

Expected result

  1. A CSV (or XML) with data similar to what is shown on the web version of the report should be downloaded

Actual result

  1. A CSV (or XML) file with column headers only and no data. I see the following in my exception.log:
    [2017-09-22 01:09:45] main.CRITICAL: Magento\Framework\Exception\LocalizedException: The element 'adminhtml.report.grid.columnSet' already has a child with alias 'ordered_qty' in .../public_html/vendor/magento/framework/Data/Structure.php:611
    Stack trace:
    #0 /vendor/magento/framework/Data/Structure.php(319): Magento\Framework\Data\Structure->_insertChild('adminhtml.repor...', 'adminhtml.repor...', NULL, 'ordered_qty')
    #1 /vendor/magento/framework/View/Layout/ScheduledStructure/Helper.php(196): Magento\Framework\Data\Structure->setAsChild('adminhtml.repor...', 'adminhtml.repor...', 'ordered_qty')
    #2 /vendor/magento/framework/View/Layout/GeneratorPool.php(115): Magento\Framework\View\Layout\ScheduledStructure\Helper->scheduleElement(Object(Magento\Framework\View\Layout\ScheduledStructure), Object(Magento\Framework\View\Layout\Data\Structure), 'adminhtml.repor...')
    #3 /vendor/magento/module-backend/Model/View/Layout/GeneratorPool.php(56): Magento\Framework\View\Layout\GeneratorPool->buildStructure(Object(Magento\Framework\View\Layout\ScheduledStructure), Object(Magento\Framework\View\Layout\Data\Structure))
    #4 /vendor/magento/framework/View/Layout/GeneratorPool.php(84): Magento\Backend\Model\View\Layout\GeneratorPool->buildStructure(Object(Magento\Framework\View\Layout\ScheduledStructure), Object(Magento\Framework\View\Layout\Data\Structure))
    #5 /vendor/magento/framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
    #6 /vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout->generateElements()
    #7 /vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
    #8 /vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
    #9 /vendor/magento/framework/View/Page/Config.php(197): Magento\Framework\View\Layout\Builder->build()
    #10 /vendor/magento/framework/View/Page/Config.php(207): Magento\Framework\View\Page\Config->build()
    #11 /vendor/magento/framework/App/View.php(170): Magento\Framework\View\Page\Config->publicBuild()
    #12 /vendor/magento/framework/App/View.php(114): Magento\Framework\App\View->loadLayoutUpdates()
    #13 /vendor/magento/module-reports/Controller/Adminhtml/Report/Product/ExportSoldCsv.php(29): Magento\Framework\App\View->loadLayout()
    #14 /vendor/magento/framework/App/Action/Action.php(102): Magento\Reports\Controller\Adminhtml\Report\Product\ExportSoldCsv->execute()
    #15 /vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
    #16 /vendor/magento/framework/Interception/Interceptor.php(74): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
    #17 /vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Reports\Controller\Adminhtml\Report\Product\ExportSoldCsv\Interceptor->___callParent('dispatch', Array)
    #18 /vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Reports...', 'dispatch', Object(Magento\Reports\Controller\Adminhtml\Report\Product\ExportSoldCsv\Interceptor), Array, 'adminAuthentica...')
    #19 /vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
    #20 /vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Reports\Controller\Adminhtml\Report\Product\ExportSoldCsv\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #21 /vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Reports...', 'dispatch', Object(Magento\Reports\Controller\Adminhtml\Report\Product\ExportSoldCsv\Interceptor), Array, 'adminMassaction...')
    #22 /vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Reports\Controller\Adminhtml\Report\Product\ExportSoldCsv\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
    #23 /vendor/magento/framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Reports\Controller\Adminhtml\Report\Product\ExportSoldCsv\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #24 /var/generation/Magento/Reports/Controller/Adminhtml/Report/Product/ExportSoldCsv/Interceptor.php(26): Magento\Reports\Controller\Adminhtml\Report\Product\ExportSoldCsv\Interceptor->___callPlugins('dispatch', Array, Array)
    #25 /vendor/magento/framework/App/FrontController.php(55): Magento\Reports\Controller\Adminhtml\Report\Product\ExportSoldCsv\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
    #26 /vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
    #27 /vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
    #28 /vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
    #29 /vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
    #30 /vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #31 /var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
    #32 /vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
    #33 /vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
    #34 /index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
    #35 {main} [] []
magento-engcom-team commented 7 years ago

@nikonratm, thank you for your report. We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.

bordeo commented 6 years ago

I experienced the same issue and i propose a fix with this pull request https://github.com/magento/magento2/pull/12909

mzeis commented 6 years ago

@bordeo Thanks for your PR! As this issue was closed of @magento-engcom-team becaut it could not be reproduced: please can you add information in which exact version you experienced the version and add the exact steps to reproduce so the CET can reproduce it? Thanks!

kanduvisla commented 6 years ago

I have this same issue when I try to export an 'ordered products report' in Magento 2.1.10. The resulting CSV only has the headers, but not the data.

viperet commented 6 years ago

I've noticed that CSV report contains only headers when there were no orders on the first day of the range for the report. Thanks, pull request #12909 by @bordeo solved this problem for me (Magento 2.1.10).

kanduvisla commented 6 years ago

Could @magento-engcom-team try to reproduce this issue with the new insight of @viperet ?

I've noticed that CSV report contains only headers when there were no orders on the first day of the range for the report.

If so, I think this issue should be reopened and addressed accordingly.

kanduvisla commented 6 years ago

@magento-engcom-team , @viperet : I can confirm the behavior: when the selected startdate does not have an order, only the headers are exported; when the startdate does contain an order, the export works as expected.

Could this be confirmed (and reopened?)

digvijay2017 commented 6 years ago

I have also noticed this issue. This issue is occurring in Magento 2.1.12, Magento 2.2.1 and Magento 2.2.2 as well. Not only CSV, even Excel file also blank. @magento-engcom-team can you reopen the issue? I have not got this issue in Magento 2.1.8.

screenshot from 2018-05-17 12-13-43

screenshot from 2018-05-17 12-14-13

kgillis-atmosol commented 6 years ago

I am also seeing this issue on 2.2.0. Specifically, it happens for us when you select the Show By: Month option - the Show By: Days works fine. Both the csv export and the Excel export show only the column headers, no data.

danmentzer commented 6 years ago

I am also seeing this as well Preconditions Magento Commerce ver. 2.2.3 PHP 7 / MySQL 5.6 Steps to reproduce Go to Reports > Products > Ordered Choose Range and Show By: Month or Year Hit Export to: CSV (or XML) Expected result A CSV (or XML) with data similar to what is shown on the web version of the report should be downloaded Actual result A CSV (or XML) file with column headers only and no data.

The grid works fine it is only the export of the data that is an issue

bordeo commented 6 years ago

I proposed a fix with this pull request #12909 but I don’t have much time to investigate if it breaks something else. If someone want to deeply test my fix I’ll really appreciate.

iindranil commented 6 years ago

I am having this issue, Same product showing multiple times in a same date. It must be show one time with total ordered qty. Checkout the screen-shot.

2575f41cfd345394e0085a07404556d3

ishakhsuvarov commented 6 years ago

Reopening based on additional reports.

ghost commented 6 years ago

@nikonratm, thank you for your report. We were not able to reproduce this issue by following the steps you provided. Please provide more detailed steps to reproduce or try to reproduce this issue on a clean installation or latest release. default

samanaveen commented 6 years ago

I am also seeing this issue after upgrading to 2.2.3. When you select the Show By filter it working fine. But export file showing only the column headers, no data.

ghost commented 6 years ago

We are closing this issue due to inactivity. If someone would like to update it, please reopen the issue.

kgillis-atmosol commented 6 years ago

I was seeing this issue in 2.2.0, easily replicated by following the steps given in the original issue report. However, as of upgrading the instance to 2.2.5, the issue is no longer occurring. So a fix for this seems to have been put in as part of the upgrades. I have no idea if it's available as a separate patch for systems prior to 2.2.5 (or 2.2.4 - I don't see any reports here of the issue happening in 2.2.4, the latest reported seems to be 2.2.3).

Akki-8388 commented 6 years ago

I get same issue when i export CSV its showing blank is there any solution please share it https://magento.stackexchange.com/questions/242468/magento2-order-product-report-showing-blank-when-while-export-in-csv