Skip to main content
CalcBuilder logo

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

  1. On Components → Calc Builder tick one or more calculators.
  2. Click Export. An .xml file (<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).
  3. If you tick several calculators, you get a calcbuilderexport.zip file with one .xml per calculator. Unzip it before importing.

Import

  1. Click Import and choose an .xml file produced by Export. Import one .xml file at a time (a .zip is not accepted directly).
  2. 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_calcbuilder is embedded (encoded) inside the same _export.xml file, 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_calcbuilder under 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, .ods and .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.

...
IA Calculators

Let our AI assistant generate your CalcBuilder calculators (pack of 5 calculators)

Buy now!
...
List Manager

Build different lists for your site

Buy now!