Chapter 4. Templates guide: How to create and edit templates for Fanurio

Table of Contents

4.1. Getting started
4.1.1. Creating an invoice template in 10 minutes or less
4.1.2. Installing a template
4.1.3. About Freemarker
4.2. Using the template editor
4.2.1. Basic settings
4.2.2. Adjust the look and format using CSS (for advanced users only!)
4.3. The anatomy of a simple template
4.3.1. Placeholders or how to access fields
4.3.2. Built-ins or how to get more details about a field
4.3.3. Directives or how to perform operations on fields
4.4. Charts (for advanced users)
4.4.1. The jfreechart directive
4.4.2. Chart types Area charts Category area charts XY area charts Time series area charts Bar charts Bar charts Stacked bar charts Line charts Category line charts XY line charts Time series line charts Pie charts Pie charts Ring charts
4.4.3. Chart properties Chart Title and subtitles Legend Plot Renderer Domain axis Range axis
4.5. Creating templates the easy way
4.5.1. Using directives in tables (important!)
4.5.2. HyperText Markup Language (.html)
4.5.3. Microsoft Word (.docx)
4.5.4. OpenDocument Text (.odt)
4.5.5. OpenDocument Spreadsheet (.ods)
4.6. Creating templates like a professional (HTML and CSS)
4.6.1. Page formatting
4.6.2. Fonts
4.7. Creating templates like a professional (Plain Text and XML)
4.7.1. Example: Quicken
4.7.2. Example: Scribus (DTP)
4.8. A comparison of all supported file formats
4.9. Placeholders reference
4.9.1. Business
4.9.2. Client
4.9.3. Invoice
4.9.4. Item
4.9.5. Payment
4.9.6. Deposit
4.9.7. Tax
4.9.8. Invoice Project
4.9.9. Time Entry
4.9.10. Task
4.9.11. Expense
4.9.12. Trip
4.9.13. Person
4.9.14. Projects Report
4.9.15. Time Report
4.9.16. Tasks Report
4.9.17. Expenses Report
4.9.18. Trips Report
4.9.19. Sales Report

This guide shows you how to create or edit templates that you can use to export documents like invoices.

4.1. Getting started

This guide shows you how to create a template from scratch but in most cases, you won't have to do that. Almost any template can be created a lot easier using the template editor. Even our support team prefers to use the editor instead of coding templates by hand.

Fanurio can handle templates in several file formats like HTML, Microsoft Word 2007 or OpenDocument Text. However, HTML is the recommended format for templates in Fanurio. The template editor also creates HTML templates. You can find a list of all supported file formats with comments on each one of them at the end of this guide.

If you create templates in HTML or any other format, it's important that you read the template language section and the section on how to use directives in tables.

4.1.1. Creating an invoice template in 10 minutes or less

The most recommended way of creating an invoice template is to use the template editor. Even power users can do a lot of tweaks just from the editor.

Here's how to create your first template:

  1. Go to File » Template Editor to open the template editor.

  2. Go through all the sections of the editor and check the fields you want to include in your template. You can configure things like your logo, the visible columns, the totals or the names of the columns.

    To see how it looks like after you make some changes, click Update or press F5 (Windows), Ctrl+R (Linux) or Cmd+R (Mac OS X).

  3. Click Save to save the template to the templates folder when you're done. Later, when you'll want to export an invoice to HTML, you can use this template.

If you want to make further adjustments to the template, use the template editor and click the Open button to open it. To learn more about the template editor, make sure you read the section that describes it.

If you have problems customizing or creating a template, you can always contact us for help.

4.1.2. Installing a template

Installing a template is just a matter of copying one or more files to a certain folder. Go to File » Open Templates Folder to open the folder where you want to install the template. For invoice templates, use File » Open Templates Folder » Invoices.

If you are using an HTML template that uses specific fonts and images, make sure you also copy those files to the templates folder.

4.1.3. About Freemarker

Fanurio uses the FreeMarker template language for its templates. Freemarker is a powerful and mature template language that can be used to create both simple and complex templates. FreeMarker can be used to generate any kind of text: HTML, XML, RTF, etc.

This guide doesn't cover all FreeMarker concepts but only those that are absolutely necessary. For a detailed guide on the FreeMarker language, go to