Reports

I reports in Koha sono un modo per raccogliere i dati. Essi sono usati per generare statistiche, liste di utenti, liste di collocazioni sugli scaffali o ogni tipo di lista dei dati presenti nel database.

  • Vai a: Più > Reports

Custom reports

Koha’s data is stored in a MySQL database which means that librarians can generate nearly any report they would like by either using the guided reports wizard or writing their own SQL query.

Add custom report

Guided report wizard

Il wizard ti guida in 6 passi per creare un report.

Passo 1: Scegli il modulo a cui si riferisce il report. Verranno determinate le tabelle e i campi disponibili per la query.

“Report is public” should be left to the default of “No” in most cases especially if the report contains patron or other sensitive information. A public report can be accessed using the JSON reports services by anyone and without authentication.

First step of creating a guided report - choosing which module to work on and whether report is public or not

Nota

Se il tuo amministratore di sistema ha impostato la memcache per il tuo server, vedrai un’opzione in più relativa alla durata della Cache. Si riferisce ai report pubblici. Se definisci un report come pubblico, verrà fatto girare costantemente, e sovraccaricherà il sistema. Impostare questo valore eviterà il sovraccarico.

Creating a guided report - define the cache expiry time

Passo 2: Scegli il tipo di report. Per adesso, l’unica scelta possibile è tabulare.

Second step of creating a guided report - choosing type

Step 3: Choose the fields you want in your report. You can select multiple fields and add them all at once by using CTRL+click on each item you want to add before clicking the Add button.

Third step of creating a guided report - select columns for display

Step 4: Choose any limits you might want to apply to your report (such as item types or branches). If you don’t want to apply any limits, simply click “Next” instead of choosing an option.

Fourth step of creating a guided report - select criteria to limit on

Step 5: Perform math functions. If you don’t want to do any calculations, simply click “Next” instead of choosing an option.

Fifth step of creating a guided report - pick column to total

Step 6: Choose data order. If you want the data to print out in the order it’s found in the database, simply click “Finish”.

Sixth step of creating a guided report - Choose how you want the report ordered

When you are finished you will be presented with the SQL generated by the report wizard. From here you can choose to save the report by clicking “Finish” or copy the SQL and make edits to it by hand.

Confirm custom report

Se scegli di salvare il report, ti sarà chiesto di dargli un nome, di eventualmento di assegnarlo a un gruppo e a un sottogruppo, di eventualmente inserire delle note

Save custom report

Once your report is saved it will appear on the “Use saved” page with all other saved reports.

List of saved reports, "All" tab is selected

Nota

  • You can customize the columns of this table in the “Table settings” section of the Administration module (table id: table_reports).

Da qui puoi fare modifiche, far eseguire un report o pianificare l’elaborazione di un report. Per trovare il report che hai creato puoi ordinare la tabella per il valore di ogni colonna cliccando sulla testata. Uno degli ordinamenti migliore è quello per data di creazione. Puoi anche filtrare i risultati usando il menu sulla sinistra o usare le tabulazioni per vedere i tuoi raggruppamenti.

Crea un report da SQL

In addition to the report wizard, you have the option to write your own queries using SQL. To find reports written by other Koha users, visit the Koha wiki: http://wiki.koha-community.org/wiki/SQL_Reports_Library. You can also find your database structure in /installer/data/mysql/kohastructure.sql or online at: http://schema.koha-community.org.

To add your query, click the link to “Create from SQL” on the main reports module

Reports main page

or the “New report” button at the top of the “Saved reports” page.

New report button is pressed and the options are New guided report and New SQL report

Compila nel form presentato

New report from SQL form

  • Report name: the name is what will appear on the “Saved reports” page to help you identify the report later. It will also be searchable using the filters found on the left of the “Saved reports” page.

  • Report group: you can use the “Report group” to organize your reports in tabs on the “Saved reports” page. You can choose from the list of existing groups, or create one on the fly by choosing the “or create” radio button.

    New report from SQL form, the group drop-down menu is open

    Report groups are set in the REPORT_GROUP authorized value category.

    Avvertimento

    If you’re adding a report group on the fly, the code should not include special characters or spaces.

  • Report subgroup: if you chose a report group, this field will appear to further organize your reports. Choose a subgroup from the list, or create one on the fly by choosing the “or create” radio button.

    Report subgroups are set in the REPORT_SUBGROUP authorized value category.

    Nota

    Report subgroups need to have unique values in “Authorized value” and “Description”. The “Description (OPAC)” field needs to contain the authorized value for the report group that the subgroup falls under.

    Avvertimento

    If you’re adding a report subgroup on the fly, the code should not include special characters or spaces.

  • Report is public: this should be left to the default of “No” in most cases, especially if the report contains patron or other sensitive information. A public report can be accessed using the JSON reports services by anyone and without authentication.

  • Cache expiry: this field will only appear if your system administrator has set up memcache on your server. This is related to public reports. If you make the report public, it’s constantly running and will cause a large load on your system. Setting this value prevents that.

  • Notes: notes will appear on the “Saved reports” page, and can be used to provide more details about the report or tips on how to enter values when it runs.

  • SQL: type or paste the SQL for the report (see report writing tips below).

Once everything is entered click the “Save report” button and you’ll be presented with options to run it. From here, you can also edit it, duplicate it, or schedule it to be run later.

Once a report is saved, you do not have to recreate it, it will appear on the “Saved reports” page with all other saved reports.

List of saved reports, "All" tab is selected

Nota

You can customize the columns of this table in the “Table settings” section of the Administration module (table id: table_reports).

From the “Saved reports” page, you can make edits, run the report, or schedule a time to run the report later. To find the report you created, you can sort by any of the columns by clicking on the column header (creation date is the best to find the report you just added). You can also filter your results using the filter menu on the left or use the tabs to find reports based on your custom groups.

Report writing tips

Autocomplete

When you start typing in the SQL field, autocomplete options will be displayed.

SQL field when creating a report from SQL, in the box, SEL is typed and a suggestion for SELECT is displayed

Use the arrows on your keyboard to choose the correct option and press “Enter” or “Tab” to insert it into your report, or simply click on the option to insert it.

Autocomplete options include:

  • SQL keywords such as SELECT, FROM, WHERE, etc.

  • table names

  • column names

    Nota

    To have suggestions for column names, you must type the table name first, followed by a period, then start typing the column name.

    For example, to have the suggestion for cardnumber, you must type borrowers.ca.

    SQL field when creating a report from SQL, in the box, SELECT borrowers.ca is typed and suggestions for borrowers.cardnumber and borrowers.categorycode are displayed

Runtime parameters

Se pensi che il tuo report pesi troppo sull macchina oppure tu voi mettere dei filtri, Koha ti permette di definire dei valori parametrici da inserire prima dell’esecuzione. In pratica questi valori funzionano da filtro e definiscono meglio i risultati che ottieni.

Click the button “Insert runtime parameter” and choose which parameter to add.

The Insert runtime parameter button is pressed and the different options are shown

  • Authorized value: will display a drop down menu of the value descriptions from the chosen authorized value category. The authorized value code will be inserted in the report when it is run.

  • Bibliographic framework: will display a drop down menu of MARC bibliographic frameworks. The framework code will be inserted in the report when it is run.

  • Classification sources: will display a drop down menu of classification sources. The classification code will be inserted in the report when it is run.

  • Date: will display a calendar to pick a date. The date in YYYY-MM-DD format will be inserted in the report when it is run.

  • Item types: will display a drop down menu of item types. The item type code will be inserted in the report when it is run.

  • Libraries: will display a drop down menu of libraries. The library code (branchcode) will be inserted in the report when it is run.

  • List: will display a large text box in which the user can enter many values, one per line. Those values will be inserted in the report, separated by commas, when it is run.

    Avvertimento

    In the case of the list parameter, users must write one value per line.

  • Patron categories: will display a drop down menu of patron categories. The category code will be inserted in the report when it is run.

  • Cash registers: will display a drop down menu of cash registers. The cash register’s internal id will be inserted in the report when it is run.

  • Debit types: will display a drop down menu of debit types. The debit type code will be inserted in the report when it is run.

  • Credit types: will display a drop down menu of credit types. The credit type code will be inserted in the report when it is run.

  • Text field: will display an empty text field in which the user can enter any text.

    Nota

    Devi mettere «%» in una casella di testo affinchè il sistema non la consideri nella query. Altrimenti il campo verrà considerato «» (stringa vuota o NULL), che è diverso da non considerare il filtro nella query SQL.

    For example entering nothing for: «title=<<Enter title>>» will display results with title=”” (no title).

    If you want to have to have something not mandatory, use «title like <<Enter title>>» and enter a % at run time instead of nothing.

After you choose the type of runtime parameter, it will ask you for the parameter label. This is what the user will see as the label for the choice they have to make or text they have to enter.

The syntax inserted into the report is <<Label|authorized_value>>.

  • The << and >> are just delimiters to indicate the start and end of the runtime parameter.

  • The label will be displayed on the left of the choice or value to enter.

  • The authorized_value can be omitted if not applicable. If it is absent, a free text field will be displayed. If it contains an authorized code (see table below), a drop down of the values will be displayed.

Nota

You can write those in manually as well, you don’t have to go through the “Insert runtime parameter” button. As long as the syntax is correct, Koha will interpret it as a runtime parameter.

List of parameters that can be used in runtime parameters

Parameter

What the user sees

What gets inserted in query

date

date picker

validly formatted date

branches

drop down of branch names

branch code

itemtypes

drop down of item type names

item type

categorycode

drop down of patron category descriptions

borrower category code

biblio_framework

drop down of MARC bibliographic frameworks

framework code

list

large text box

comma separated values

(auth-value-category)

drop down of auth-value descriptions in category

authorized value

(nothing)

text box

entered text

Nota

You can have more than one runtime parameter in a given SQL query.

Example 1

SELECT surname,
       firstname
FROM borrowers
WHERE branchcode = <<Enter patrons library|branches>>
    AND surname LIKE <<Enter filter for patron surname (% if none)>>

When running the report, the user is asked to choose a library from a drop-down menu and enter a surname in an input text field

Example 2

SELECT *
FROM items
WHERE homebranch = <<Pick your branch|branches>>
    AND barcode LIKE <<Partial barcode value here>>

When running the report, the user is asked to choose a library from a drop-down menu and enter a barcode in an input text field

Example 3

SELECT title,
       author
FROM biblio
WHERE frameworkcode = <<Enter the frameworkcode|biblio_framework>>

When running the report, the user is asked to choose a bibliographic framework from a drop-down menu

Example 4

SELECT cardnumber,
       surname,
       firstname
FROM borrowers
WHERE dateexpiry <= <<Expiry date|date>>

When running the report, the user is asked to pick a date in the calendar (date picker)

Example 5

SELECT *
FROM items
WHERE itemnumber IN <<List of itemnumbers (one per line)|list>>

When running the report, the user is asked to enter a list of values

Avvertimento

In the case of the list parameter, users must write one value per line.

SQL report from Mana

In the «Create report from SQL», you can search Mana KB for pre-made reports by clicking on «New report» and choosing «New SQL from Mana».

image1428

Nota

This option will only appear if you’ve configured Mana KB in the administration module.

You will be prompted to enter keywords to search the knowledge base.

image1429

In the search results, you will see

  • the details of the report (name, notes and type)

  • how many people have used this entry (# of users)

  • when it was used for the last time (last import)

  • additional comments made by other Koha users (comments)

image1430

Click on «Import» to import a copy of the report in your own saved reports.

You can then edit it, duplicate it, delete it, run it as you would any of your own reports.

Duplicate report

I reports possono essere aggiunti duplicando un report esistente. Visita la pagina “Reports salvati” per vedere tutti i reports che il tuo sistema ha già.

image895

Alla destra di ogn report c’è un menu “Azioni”.. Cliccaci sopra e scegli “Duplica” per usare un report esistente come base del il nuovo report. Il codice SQL del nuovo report sarà copiato da quello vecchio e ti sarà facile cambiarlo secodo le tue esigenze.

Edit custom reports

Every report can be edited from the reports lists. To see the list of reports already stored in Koha, click “Use saved.”

List of saved reports, "All" tab is selected

Nota

  • You can customize the columns of this table in the “Table settings” section of the Administration module (table id: table_reports).

Per trovare il report che hai vuoi moodificare puoi ordinare la tabella per il valore di ogni colonna cliccando sulla testata. Puoi anche filtrare i risultati usando il menu sulla sinistra o usare le tabulazioni per vedere i tuoi raggruppamenti.

Da questa lista puoi modificare ogni report personalizzato cliccando “Azioni” a destra del report e successivamente “Modifica” nel menu che appare.

"Edit" option of the report action button

The form to edit the report will appear. Use the «update button» to save your modifications or click on «update and run SQL» to save and display the report results.

The edit report form with the 'update' button and 'save and run sql' button

Running custom reports

Una volta che un report è salvato, puoi usarlo andando nella pagina “report salvati”, cliccando sul bottone “Azioni” posto a destra del report e scegliendo la voce “Esegui”.

image899

Quando si esegue un report verrà chiesto sia di immettere alcuni valori

image900

o di vedere subito i risultati

image901

Dai risultati puoi scegliere di far girare di nuovo il report cliccando su “Elabora il report”, modificarlo cliccando “Modifica” o andare oltre creandone un nuovo cliccando su “Nuovo. Puoi anche scaricare i risultati scegliendo un tipo di file in fondo, vicino a “Scarica il report”, e cliccando “Scarica”

Nota

A comma separated text file is a CSV file and it can be opened by any spreadsheet application.

Send report output to batch modification tools

After running a report that contains itemnumbers, biblionumbers and/or patron cardnumbers the list of numbers can be imported directly into the relevant batch modification tool by clicking the “Batch operations with X visible records” button in the report results. The X depends on the number of records you have chosen to display on screen (up to 1000).

image1343

Statistics reports

Statistic reports will show you counts and sums. These reports are all about numbers and statistics, for reports that return more detailed data, use the guided report wizard. These reports are limited in what data they can look at, so it’s often recommended to use custom reports for official end of the year statistics.

Acquisitions statistics

Nota

Questi report sono limitati per quanto riguarda i dati disponibili, così spesso si consiglia di utilizzare i report personalizzati <custom-reports-label> le statistiche ufficiali di fine anno.

Using the form provided, choose which value you would like to appear in the column and which will appear in the row.

Using the form provided, choose which value you would like to appear in the column and which will appear in the row.

Se scegli l’output sul browser, i risultati verranno presentati sullo schermo.

image903

Puoi anche scegliere di esportare in un fai che puoi manipolare secondo le tue esigenze.

Quando generi il report, puoi scegliere tra contare o sommare i valori.

image904

Scegliendo ammontare mostrerà i risultati come somma degli ammontare spesi.

image905

Patron statistics

Nota

Questi report sono limitati per quanto riguarda i dati disponibili, così spesso si consiglia di utilizzare i report personalizzati <custom-reports-label> le statistiche ufficiali di fine anno.

Using the form provided, choose which value you would like to appear in the column and which will appear in the row.

View of patron form for patron statistics

Se scegli l’output sul browser, i risultati verranno presentati sullo schermo.

image907

A seconda della tua selezione, potresti vedere qualche richiesta di informazioni sopra la tabella dei risultati. Potresti anche scegliere di esportare in un file da manipolare per le tue necessità

Catalog statistics

Nota

Questi report sono limitati per quanto riguarda i dati disponibili, così spesso si consiglia di utilizzare i report personalizzati <custom-reports-label> le statistiche ufficiali di fine anno.

Using the form provided, choose which value you would like to appear in the column and which will appear in the row.

image908

Se scegli l’output sul browser, i risultati verranno presentati sullo schermo.

image909

Puoi anche scegliere di esportare in un fai che puoi manipolare secondo le tue esigenze.

Circulation statistics

Nota

Questi report sono limitati per quanto riguarda i dati disponibili, così spesso si consiglia di utilizzare i report personalizzati <custom-reports-label> le statistiche ufficiali di fine anno.

Using the form provided, choose which value you would like to appear in the column and which will appear in the row.

Circulation statistics reporting wizard, with options to select the report parameters

Se scegli l’output sul browser, i risultati verranno presentati sullo schermo.

image911

Puoi anche scegliere di esportare in un fai che puoi manipolare secondo le tue esigenze.

Nota

Per ottenere un quadro completo della vostra circolazione mensile o giornaliera, è possibile eseguire il report due volte, una volta per “Tipo” di “Prestito” e un’altra per “Rinnovo”.

Questo report utilizza “Periodo”, o data, filtro che consente di limitare a un mese semplicemente selezionando dal primo giorno del primo mese fino al primo giorno del mese successivo. Ad esempio, 10/1 a 11/1 a trovare le statistiche per il mese di ottobre.

  • Per trovare le statistiche giornaliere, seleziona l’intervallo di date. </br> Per esempio: «Voglio i dati di circolazione dalla data XXX fino a, ma non includendo, la data XXX.»

  • Per estrarre tutto un mese puoi indicare: 01/11/2009 a 01/12/2009

  • Per estrarre un anno intero puoi mettere ad esempio: 01/01/2009 a 01/01/2010

  • Per un giorno solo puoi inserire così: 15/11/2009 a 16/11/2009. Con questo avrai la circolazione del giorno 15.

Tracciare la consultazione in loco

Using the Circulation statistics reporting wizard you can run reports on in house usage of items simply by choosing “Local use” from the “Type” pull down:

Circulation statistics reporting wizard with Type drop-down menu open and "Local use" highlighted.

Serials statistics

Nota

Questi report sono limitati per quanto riguarda i dati disponibili, così spesso si consiglia di utilizzare i report personalizzati <custom-reports-label> le statistiche ufficiali di fine anno.

Usando la maschera fornita, scegli come elencare le risorse in continuazione nel tuo sistema.

serialsform

Se scegli l’output sul browser, i risultati verranno presentati sullo schermo.

image914

Puoi anche scegliere di esportare in un fai che puoi manipolare secondo le tue esigenze.

Holds statistics

Nota

Questi report sono limitati per quanto riguarda i dati disponibili, così spesso si consiglia di utilizzare i report personalizzati <custom-reports-label> le statistiche ufficiali di fine anno.

Usando la form puoi vedere le statistiche delle prenotazioni, fatte, riempite, cancellate ecc. della tua biblioteca. Dalla form scegli che cosa vuoi mostrare nella colonna, e quali valori avere nella riga. Puoi anche usare i filtri a destra della form.

Form for holds statistics

Se scegli l’output sul browser, i risultati verranno presentati sullo schermo.

image916

Puoi anche scegliere di esportare in un fai che puoi manipolare secondo le tue esigenze.

Utenti con più prestiti

Il report guidato ti mostrerà gli utenti con più prestiti.

Form to select parameters to run Top checkouts report

Se scegli l’output sul browser, i risultati verranno presentati sullo schermo.

image918

Puoi anche scegliere di esportare in un fai che puoi manipolare secondo le tue esigenze.

Most circulated items

Il report guidato ti mostrerà le copie che sono state prestate maggiormente.

image919

Se scegli l’output sul browser, i risultati verranno presentati sullo schermo.

image920

Puoi anche scegliere di esportare in un fai che puoi manipolare secondo le tue esigenze.

Utenti senza prestiti

Il report guidato ti mostrerà quali utenti non hanno preso prestiti.

Report form for creating a report of patrons who have never checked out items

Se scegli l’output sul browser, i risultati verranno presentati sullo schermo.

image922

Puoi anche scegliere di esportare in un fai che puoi manipolare secondo le tue esigenze.

Copie mai prestate

Questo report ti mostrerà le copie mai andate in prestito.

Form for the report of items with no checkouts

Se scegli l’output sul browser, i risultati verranno presentati sullo schermo.

image924

Puoi anche scegliere di esportare in un fai che puoi manipolare secondo le tue esigenze.

Catalog by item type

Questo report ti mostrerà i totali di copie per tipologia in una biblioteca.

Catalog by item type

Se scegli l’output sul browser, i risultati verranno presentati sullo schermo.

Catalog by item type results

Puoi anche scegliere di esportare in un fai che puoi manipolare secondo le tue esigenze.

Lost items

Questo rapporto vi permetterà di generare un elenco di copie che sono stati contrassegnate con la tipologia “Lost” (smarrite) all’interno del sistema

Input for lost item report

Once you have chosen parameters, you will see the corresponding list of items.

Results of lost item report

Nota

  • You can customize the columns of this table in the “Table settings” section of the Administration module (table id: lostitems-table).

Orders by fund

If you use the Acquisitions module, you will be able to see all the items that were ordered in each fund.

image1499

Once you choose the fund you wish to view, you can export the results or view them in the browser. If you choose to view them directly, you will be shown the list of orders.

Example of a report result of Orders by fund

Nota

  • You can customize the columns of this table in the “Table settings” section of the Administration module (table id: funds-table).

Average loan time

Questo report ti dirà quanto stammo in media in prestito le copie secondo i criteri che inserirai nella maschera:

Wizard to generate report for average loan time, with options to select the report parameters (checkout date, patron category, item type...)

Se scegli l’output sul browser, i risultati verranno presentati sullo schermo.

image929

Puoi anche scegliere di esportare in un fai che puoi manipolare secondo le tue esigenze.

Report dictionary

The report dictionary is a way to pre-define common filters you’d like to apply to your reports. This is a good way to add in filters that the report wizard doesn’t include by default. To add a new definition, or filter, click “New definition” on the reports dictionary page and follow the 4 step process.

Passo 1: dai un nome alla definizione e fornisci una descrizione, se occorre

image930

Passo 2: Scegli il modulo che vuoi interrogare.

image931

Passo 3: scegli le colonne da estrarre dall’elenco delle tabelle.

image932

Passo 4: scegli il valore(i) dal campo(i). Saranno automaticamente popolati con le opzioni disponibili nel database.

image933

Conferma le scelte per salvare la definizione.

image934

Le tue definizioni compariranno nella pagina del Dizionario dei report

image935

Cosi, quando genererai dei reports con il modulo a cui hai collegato il dizionario, vedrai una nuova opzione per filtrare i risultati dopo i filtri usuali.

image936

Report plugins

Some plugins that are available can be used to make or enhance reports.

  • Get there: More > Reports > Report plugins > Report plugins

From this page, you will see only report-type plugins.

See the managing plugins section of this manual to learn how to manage your report-type plugins.