
CalcBuilder Tutorial
Calc Builder 6: import and export of calculators
Calculators are portable. Use export/import for backups, for moving a calculator from a staging site to production, or for keeping a library of reusable calculators.
Export
- On Components → Calc Builder tick one or more calculators.
- Click Export. An
.xmlfile (<calculator_name>_export.xml) downloads containing the form fields, the PHP and JS code, all layouts, sections, print preferences and, for calculators that use a spreadsheet, the Excel settings, the cell mapping and the Excel file itself (see Calculators that use an Excel file below). - If you tick several calculators, you get a
calcbuilderexport.zipfile with one.xmlper calculator. Unzip it before importing.
Import
- Click Import and choose an
.xmlfile produced by Export. Import one.xmlfile at a time (a.zipis not accepted directly). - The calculator appears in the list with a new Id. Open it and check the Options/menu link, any SQL query fields (table names may differ between sites) and file-upload folders.
Calculators that use an Excel file
From Calc Builder 6.0.8, exporting and importing a calculator that
is driven by an Excel spreadsheet carries the spreadsheet with it. Before 6.0.8 only the settings
travelled, and you had to upload the .xlsx again by hand.
- Export: the spreadsheet stored in
media/com_calcbuilderis embedded (encoded) inside the same_export.xmlfile, together with the Excel settings and the cell mapping (which form field feeds which cell, and which cell is read back). There is no extra file to download or keep track of. - Import: the spreadsheet is restored to
media/com_calcbuilderunder a new name (a random number prefix, so it never overwrites the original site’s file) and the imported calculator is linked to that copy. The mapping is recreated, so the calculator works right after importing, with no need to re-upload the spreadsheet. - Only spreadsheet formats are restored:
.xlsx,.xlsm,.xls,.odsand.csv. If the embedded file is not valid, the calculator is still imported and you get a warning; open its Excel tab and upload the file again.
The imported calculator has its own copy of the spreadsheet. Editing the Excel file of one calculator does not change the other. Files exported with an older version do not contain the spreadsheet: after importing them, upload it in the Excel tab.
What does not travel: the menu item and module that point at the calculator, and any data the old site’s SQL fields relied on. Re-create those on the new site.