0

The Magento orders Export mechanism built-in does not export goods orders I would like to ask you how to export each order on a Worksheet Worksheet within each piece of data is a commodity information

The following are examples

<Workbook>
<Worksheet ss:Name="order1">
    <Table>
        <Row>
            <Cell><Data ss:Type="String">Order #</Data></Cell>
            <Cell><Data ss:Type="String">SKU</Data></Cell>
            <Cell><Data ss:Type="String">Qty</Data></Cell>
        </Row>
        <Row>
            <Cell><Data ss:Type="Number">1</Data></Cell>
            <Cell><Data ss:Type="String">A1</Data></Cell>
            <Cell><Data ss:Type="Number">3</Data></Cell>
        </Row>
        <Row>
            <Cell><Data ss:Type="Number">1</Data></Cell>
            <Cell><Data ss:Type="String">A2</Data></Cell>
            <Cell><Data ss:Type="Number">5</Data></Cell>
        </Row>
    </Table>
</Worksheet>
<Worksheet ss:Name="order2">
    <Table>
        <Row>
            <Cell><Data ss:Type="String">Order #</Data></Cell>
            <Cell><Data ss:Type="String">SKU</Data></Cell>
            <Cell><Data ss:Type="String">Qty</Data></Cell>
        </Row>
        <Row>
            <Cell><Data ss:Type="Number">2</Data></Cell>
            <Cell><Data ss:Type="String">B1</Data></Cell>
            <Cell><Data ss:Type="Number">2</Data></Cell>
        </Row>
        <Row>
            <Cell><Data ss:Type="Number">2</Data></Cell>
            <Cell><Data ss:Type="String">B2</Data></Cell>
            <Cell><Data ss:Type="Number">3</Data></Cell>
        </Row>
    </Table>
</Worksheet>

Through the the understanding lib/Varien/Convert/Parser/Xml/Excel.php, Magento itself does not support multi Worksheet Export I plan to write another one Parser, do multi-Worksheet Export.

But the bigger issue, export the data needs through app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php the _prepareColumns () processing But I can not find how to call database

I hope we can help, thank you

Maro Huang
  • 59
  • 9

1 Answers1

0

You can drop the PHPExcel library in 'lib' and Magento will autoload it without further ado in your module (You'll be needing a custom module).

Since you are writing rather than reading you should be able to work with PHPExcel within your existing memory (importing with PHPExcel can be huge).

There are no limits on what you can do with the fine control of PHPExcel, obviously you'll need to iterate your orders too and your module will need a back end.

You can put together a skeleton module, see if you can create a EXcel file (pop some of the demo code in and see if it picks up the classes etc). Then you should be able to export great reports once you have those bits working.

http://phpexcel.codeplex.com/

https://stackoverflow.com/a/4816738/1617149

Community
  • 1
  • 1
Theodores
  • 1,209
  • 1
  • 11
  • 15
  • ...let me know if you get stuck. It has been a while since I PHPExcel-d but if you can't get it working I can dig something out for you (imports and exports sostock management is in Excel2007 for a particular client). – Theodores Sep 05 '12 at 13:36