3.6.4. Data export

From time to time, you may need to export data from Kartris to a file. This might be anything from a customer list, order details, product inventory or statistical data for external analysis. Kartris provides both a built-in export for customers/orders, as well as a flexible export system that lets you write your own custom exports and save them within Kartris.
Above: The saved export controls

3.6.4.1. Orders export

You can specify a date range, the file name you wish to export as, the delimiter (marker) for each field and that indicates string values (non-numeric / text as opposed to numbers). You can optionally include the full order details field (text of the confirmation email to customer stored in the system) and incomplete orders (orders where the status checkbox 'complete' is not yet checked to indicate the order has been fully processed).

The file format is CSV - comma-separated values. This is a text format which spreadsheet programs such as MS Excel and Libre Office Calc can open. If you find data shows up in the spreadsheet with single quotes around values, try exporting again but select a double-quote as the 'string delimiter'.

3.6.4.2. Custom exports

Custom exports are saved reports that you can run to output specific data that you need. If you go to the 'Saved Exports' tab, you can see some pre-written custom exports that come as standard within Kartris - clicking on edit will allow you to see how these are constructed. An export requires the following information:

 

  • Export name (any name will do, it just lets you identify this export in a list)

  • Field delimiter (separator between different data values, normally a comma)

  • String delimiter (the marker around text / non-numeric values - experiment with a single or double-quote and open up the resulting file in your spreadsheet program such as Microsoft Excel - if you see the single or double-quote mark around data, then try using a different delimiter)

  • Database query
The database query is the key part of the export. This uses 'structured query language'  (SQL), which is a standard common language that is largely similar on different types of databases to specify which data is to be exported. A full explanation and grounding in writing SQL queries is beyond the scope of this manual, but there are plenty of books and web sites dedicated to the subject.

Microsoft Access and MS SQL Management Studio also include graphical tools to help you build queries.

Advanced users may also prefer to create stored procedures and then call these from the saved export - our standard 'Products data for data tool' export which is included in a default installation uses this method.