Geração de Relatórios

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.

Usando o formatador de relatório Mako

O formatador de relatório Mako usa a linguagem de modelo Mako para gerar relatórios. Mais informações sobre Mako e sua linguagem podem ser encontradas em makotemplates.org.

O sistema de modelagem de Mako já deve estar instalado no seu computador se Ghini é instalado.

Criar relatórios com Mako é semelhante da maneira que você poderia criar uma página da web de um modelo. É muito mais simples que o XSL Formatter(see below) e deve ser relativamente fácil de criar um modelo para qualquer pessoa com um pouco mais de experiência em programação.

O gerador de modelo usará a mesma extensão de ficheiro como o modelo que deve indicar o tipo de saída do modelo com criar. Por exemplo, para gerar uma página HTML de seu template você deve nomear o modelo algo como “report.html”. Se o modelo irá gerar um ficheiro de valor separado por vírgula você devia nomear o modelo “report.csv”.

O modelo receberá uma variável chamada “valores”, que irão conter a lista de valores na pesquisa atual.

O tipo de cada valor em “valores” será o mesmo que o domínio de busca usado na consulta de pesquisa. Para obter mais informações sobre domínios de pesquisa consulte: ref: “pesquisa-domínios”.

Se a consulta não tem um domínio de pesquisa, então os valores podem ser de um tipo diferente e o modelo de Mako deve preparado para lidar com eles.

Usando o formatador de relatório XSL

O formatador de relatório XSL requer um XSL para processador PDF para converter os dados num ficheiro PDF. Apache FOP é um processador livre e de código aberto XSL -> PDF e é recomendado.

If using Linux, Apache FOP should be installable using your package manager. On Debian/Ubuntu it is installable as fop in Synaptic or using the following command:

apt-get install fop

Installing Apache FOP on Windows

You have two options for installing FOP on Windows. The easiest way is to download the prebuilt ApacheFOP-0.95-1-setup.exe installer.

Alternatively you can download the archive. After extracting the archive you must add the directory you extracted the archive to to your PATH environment variable.