简体   繁体   English

导出报告时XML格式错误-Magento

[英]Error in xml format when exporting report - Magento

I have a problem, when exporting the report (Reports -> Sales -> Billed), the file that is downloaded is as follows: 我有一个问题,导出报告时(报告->销售->开票),下载的文件如下:

  • If I export as CSV: invoiced.csv-, attachment 如果我导出为CSV: invoiced.csv-, attachment

  • If I export as XML: invoiced.xml-, attachment 如果我导出为XML: invoiced.xml-, attachment

I can not understand why the files are coming with " -, attachment " at the end. 我不明白为什么文件结尾都带有“ -, attachment ”。 And the strange thing is that this only occurs on: 奇怪的是,这仅发生在:

  • Reports -> Sales -> Billed 报告->销售->开票
  • Reports -> Sales -> Coupons 报告->销售->优惠券

The remaining of reporting options, is working correctly. 其余报告选项正常运行。

Has anyone experienced this or have any idea what is the cause of problem? 有没有人遇到过这种情况或有什么想法是造成问题的原因?

Thank you for listening 谢谢你的聆听

Please check below file 请检查以下文件

magento\app\code\core\Mage\Adminhtml\controllers\Report\SalesController.php


1) exportInvoicedCsvAction()
2) exportInvoicedExcelAction()

check fileName in both function it should be 检查文件名在这两个功能应该是

$fileName   = 'invoiced.csv';//for csv

$fileName   = 'invoiced.xml';//for excel xml

hope this help you 希望这对你有帮助

I found another solution 我找到了另一种解决方案

Open the file: 打开文件:

app/code/core/Mage/Core/Controller/Varien/Action.php 应用程序/代码/核心/法师/核心/控制器/变种/Action.php

change: 更改:

-> setHeader ('Content-Disposition', 'attachment; filename =, true "' $ fileName.. '"') -> setHeader('Content-Disposition','attachment; filename =,true“'$ fileName ..'”')

to: 至:

-> setHeader ('Content-Disposition', 'attachment; filename =';, true "'$ fileName.."') -> setHeader('Content-Disposition','attachment; filename =';, true“'$ fileName ..”')

Basically adds, there in $ fileName ',' getting $ fileName '";' 基本上,在$ fileName'中添加$ fileName'“;' .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM