Generare relazioni

A database without exporting facilities is of little use. Ghini lets you export your data in table format (open them in your spreadsheet editor of choice), as labels (to be printed or engraved), as html pages or pdf or postscript documents.

The Report Tool

You activate the Report Tool from the main menu: Tools‣Report. The Report Tools acts on a selection, so first select something, then start the Report Tool.

Report on the whole collection.

To produce a report on your whole plant collection, a shortcut would be from the home screen, to click on the Families: in use cell.

If your focus is more on the garden location than on taxonomy and accessions, you would click on the Locations: total cell.

Reports are produced by a report engine, making use of a report template. Ghini relies upon two different report engines (Mako & XSL), and offers several report templates, meant as usable examples.

Choose the report you need, specify parameters if required, and produce the report. Ghini will open the report in the associated application.

Configuring report templates, that’s a task for who installs and configures ghini at your institution. Basically, you create a template name, indicating the report engine and specifying the template. Configured templates are static, once configured you are not expected to alter them. Only the special **scratch** template can be modified on the fly.

The remainder of this page provides technical information and links regarding the formatter engines, and gives hints on writing report templates. Writing templates comes very close to writing a computer program, and that’s beyond the scope of this manual, but we have hints that will definitely be useful to the interested reader.

Utilizzando il formattatore di Report di Mako

Il formattatore di relazione Mako utilizza il linguaggio del modello di Mako per la generazione di report. Ulteriori informazioni su Mako e il suo linguaggio si trovano sul sito makotemplates.org.

Il sistema di template Mako dovrebbe già essere installato sul tuo computer se è installato Ghini.

Creazione di report con Mako è simile nel modo in cui si creerà una pagina web da un modello. È molto più semplice di Formatter(see below) il XSL e dovrebbe essere relativamente facile creare un modello per chiunque con un po “ ma di esperienza di programmazione.

The template generator will use the same file extension as the template which should indicate the type of output the template with create. For example, to generate an HTML page from your template you should name the template something like report.html. If the template will generate a comma separated value file you should name the template report.csv.

Il modello riceverà una variabile denominata “valori” che conterranno l’elenco di valori nella ricerca attuale.

Il tipo di ogni valore in “valori” sarà lo stesso come il dominio di ricerca utilizzato nella query di ricerca. Per ulteriori informazioni su domini di ricerca vedere: ref: domini di ricerca.

Se la query non dispone di un dominio di ricerca quindi tutti i valori possono essere di diverso tipo e il modello di Mako dovrebbe preparare per gestire loro.

Utilizzando il formattatore di Report XSL

Il formattatore di relazione XSL richiede un XSL per renderer PDF per convertire i dati in un file PDF. Apache FOP è è un libero e open-source XSL-> renderer PDF ed è consigliato.

Se si utilizza Linux, Apache FOP dovrebbe essere installabile utilizzando il vostro gestore di pacchetti. Su Debian/Ubuntu è installabile come “fop “ in Synaptic o utilizzando il comando seguente:

apt-get install fop

L’installazione di Apache FOP su Windows

Ci sono due modi per installare FOP su Windows. Il più semplice è scaricando il precompilato `ApacheFOP-0.95-1-setup.exe <http://code.google.com/p/apache-fop-installer/downloads/detail?name=ApacheFOP-0.95-1-setup.exe&can=2&q=#makechanges >`_.

In alternativa è possibile scaricare l’archivio. Dopo l’estrazione dell’archivio è necessario aggiungere al PATH la directory dove è stato estratto l’archivio.