OSGI HengSin/File2PackZip

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
Any window table has export function..
..that exports to 2Pack besides Excel formats!
A choice of single record or all records!

Data Portability On Demand

  • I think we have found our holy grail of data agility in ERP.
  • Imagine able to export out any table in the window you are at for another person on another system with easy clicks.
  • Imagine able to go to another remote ADempiere instance and put back your table without an import loader!
  • Imagine keeping your data truly backup without dependence on the Database been there!
  • Imagine having your backup tables portable and readable as an XML or Excel formats at the same time!
  • Imagine not worrying about Foreign Key IDs conflicting as tables from different instances are merged into each other! (thanks to OSGI HengSin/UUID Generator)
  • This is a very convenient tool in any window. Just by selecting File > Export, you can export all the records of the Window you are looking at.
  • You have a choice to export as an Excel or 2Pack format.
  • You can export the single record in focus or all the records in the window.
  • You can select the target directory to save the file in and give it a unique name for easy managing later.
  • All this is tested on the latest OSGI HengSin codebase.


  • Following is a sample output of a single record i exported from my just PackIn Flight Schedule Module.
<?xml version="1.0" encoding="ISO-8859-1"?>
<adempiereAD Name="IS_Schedule" Version="1.0.0" AdempiereVersion="Release 3.6.0LTS @ 
2010-06-14" DataBaseVersion="2010-06-14" Description="" Author="SuperUser" 
AuthorEmail="" CreatedDate="Tue Dec 28 16:13:04 MYT 2010" UpdatedDate="Tue Dec 28 
16:13:04 MYT 2010" PackOutVersion="100" Client="11-GardenWorld-GardenWorld">
    <IS_Schedule type="table">

What about a Master-Detail window?

  • Can this work for whole window with multi-tabs such as Business Partner Window or let's say a Sales Order that has OrderLines?
  • The answer is YES! See the PackOut.xml extract for a Sales Order below:
            <Ref_OrderLine_ID reference="id"/>
            <User1_ID reference="id"/>
            <User2_ID reference="id"/>
            <C_Order_ID reference="id">108</C_Order_ID>
            <C_Tax_ID reference="id">105</C_Tax_ID>
    <C_Order type="table">
        <AD_OrgTrx_ID reference="id"/>
        <AD_User_ID reference="id"/>
        <Bill_BPartner_ID reference="id">112</Bill_BPartner_ID>
        <Bill_Location_ID reference="id">108</Bill_Location_ID>
        <Bill_User_ID reference="id"/>
  • Note the existence of 3 tabs within the xml tags.

Exporting As Excel

  • This option is an earlier separate contribution from Teo Sarca, Romania.
  • When you select the File Save As > Type as Excel you can click on X so as to get all records.
  • But the Export only export the current record backwards. So you need to be at the last record to get all. See results below:
Excel format export for Business Partner window main tab. Go to the last record and decline single record choice.

Developer's Note

  • The manner in which the 2Pack can do this magic is due to the ElementHandlers. You can modify or extend its functionality further to do say export out associated objects to the main object you are packing out.
  • For example, at the moment, Packout of table information does not include Rule objects stated in the Callout fields.
  • You can thus modify the ColumnElementHandler to do that.