[% USE KohaDates %] [% USE Koha %] [% SET footerjs = 1 %] [%- BLOCK area_name -%] [%- SWITCH area -%] [%- CASE 'CIRC' -%]Circulation [%- CASE 'CAT' -%]Catalog [%- CASE 'PAT' -%]Patrons [%- CASE 'ACQ' -%]Acquisitions [%- CASE 'ACC' -%]Accounts [%- CASE 'SER' -%]Serials [%- END -%] [%- END -%] [% INCLUDE 'doc-head-open.inc' %] Koha › Reports › Guided reports wizard [%- IF ( saved1 ) -%]› Saved reports [%- ELSIF ( create ) -%]› Create from SQL [%- ELSIF ( showsql ) -%]› Saved reports › SQL view [%- ELSIF ( execute ) -%]› Saved reports › [% name %] Report [%- ELSIF ( editsql ) -%]› Saved reports › Edit SQL report [%- END -%] [%- IF ( build1 ) -%]› Build a report, step 1 of 6: Choose a module [%- ELSIF ( build2 ) -%]› Build a report, step 2 of 6: Pick a report type [%- ELSIF ( build3 ) -%]› Build a report, step 3 of 6: Select columns for display [%- ELSIF ( build4 ) -%]› Build a report, step 4 of 6: Select criteria to limit on [%- ELSIF ( build5 ) -%]› Build a report, step 5 of 6: Pick which columns to total [%- ELSIF ( build6 ) -%]› Build a report, step 6 of 6: Select how you want the report ordered [%- END -%] [% INCLUDE 'doc-head-close.inc' %] [% IF ( saved1 ) %] [% END %] [% INCLUDE 'header.inc' %] [% INCLUDE 'circ-search.inc' %]
[% INCLUDE "reports-toolbar.inc" %] [% IF ( start ) %]

Guided reports

Use the guided reports engine to create non standard reports. This feature aims to provide some middle ground between the built in canned reports and writing custom SQL reports.

Build and run reports

[% IF ( CAN_user_reports_create_reports ) %]
[% END %] [% IF ( CAN_user_reports_execute_reports ) %]
[% END %] [% IF ( CAN_user_reports_create_reports ) %]
[% END %]

Reports Dictionary

Use the reports dictionary to define custom criteria to use in your reports

[% END %] [% IF report_converted %]
The report "[% report_converted %]" has been converted.
[% END %] [% IF ( saved1 ) %] [% IF ( savedreports ) %]

Saved reports

[% IF (usecache) %] [% END %] [% IF has_obsolete_reports %][% END %] [% FOREACH savedreport IN savedreports %] [% UNLESS ( loop.odd ) %][% ELSE %][% END %] [% IF (usecache) %] [% END %] [% IF has_obsolete_reports %] [% END %] [% END %]
  ID Report name Type Group Subgroup Notes Author Creation date Last edit Last run Public JSON URLCache expiry (seconds)Saved resultsUpdate 
[% IF ( CAN_user_reports_delete_reports ) %] [% END %] [% IF ( savedreport.report_name ) %] [% savedreport.report_name %] [% ELSE %] [ no name ] [% END %] [% savedreport.type %] [% savedreport.groupname %] [% savedreport.subgroupname %] [% savedreport.notes %] [% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %]) [% savedreport.date_created | $KohaDates %] [% savedreport.last_modified | $KohaDates with_hours => 1 %] [% savedreport.last_run | $KohaDates with_hours => 1 %] [% IF (savedreport.public) %] Yes [% ELSE %] No [% END %] [% IF (savedreport.public) %] [% OPACBaseURL %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %] [% ELSE %] [% Koha.Preference('staffClientBaseURL') %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %] [% END %] [% savedreport.cache_expiry %] [% FOR result IN savedreport.results %] [% result.date_run %]
[% END %]
[% IF savedreport.seems_obsolete %] This report seems obsolete, it uses biblioitems.marcxml field. Update SQL [% END %]
[%# There should be no space between these two buttons, it would render badly %] Run
[% IF ( CAN_user_reports_delete_reports ) %]
[% END %]
[% ELSE %]
[% IF (filter_set || filters.date || filters.author || filters.keyword) %]

No saved reports match your criteria.

[% IF ( CAN_user_reports_create_reports ) %]
[% END %] [% ELSE %]

There are no saved reports.

[% IF ( CAN_user_reports_create_reports ) %] Build a new report? [% END %] [% END %]
[% END %] [% END %] [% IF ( build1 ) %] [% IF ( cache_error) %]
Please choose a cache_expiry less than 30 days
[% END %]

Build a report

Step 1 of 6: Choose a module to report on,[% IF (usecache) %] Set cache expiry, [% END %] and choose report visibility
  1. [% IF (public) %]
  2. [% ELSE %]
  3. [% END %] [% IF (usecache) %]
  4. [% END %]
[% END %] [% IF ( build2 ) %]

Build a report

Step 2 of 6: Pick a report type
[% END %] [% IF ( build3 ) %]

Build a report

Step 3 of 6: Select columns for display

Note: Be careful selecting when selecting columns. If your choice is too broad it could result in a very large report that will either not complete, or slow your system down.


[% END %] [% IF ( build4 ) %]

Build a report

Step 4 of 6: Select criteria to limit on [% FOREACH criteri IN criteria %] [% IF ( criteri.date ) %] [% ELSE %] [% IF ( criteri.textrange ) %] [% ELSE %] [% IF ( criteri.daterange ) %] [% ELSE %] [% END %] [% END %] [% END %] [% END %]
[% INCLUDE 'date-format.inc' %]
from to
from to [% INCLUDE 'date-format.inc' %]
[% IF ( definitions ) %]
Dictionary definitions [% FOREACH definition IN definitions %] [% END %]
[% definition.name %]
[% END %]
[% END %] [% IF ( build5 ) %]

Build a report

Step 5 of 6: Pick which columns to total

[% FOREACH total_b IN total_by %] [% END %]
[% END %] [% IF ( build6 ) %]

Build a report

Step 6 of 6: Choose how you want the report ordered

[% FOREACH order_b IN order_by %] [% END %]
[% END %] [% IF ( showreport ) %]

Confirm custom report

Your report will be generated with the following SQL statement.

[% sql |html %]

You will need to save the report before you can execute it

[% END %] [% IF ( save ) %]
Save your custom report
  1. Required
  2. [% PROCESS group_and_subgroup_selection %]
[% END %] [% IF ( warn_authval_problem ) %]

Errors found when processing parameters for report: [% name %]

[% FOREACH problematic_authval IN problematic_authvals %]

[% problematic_authval.name %]: The authorized value category ([% problematic_authval.authval %]) you selected does not exist.

[% END %]
[% IF ( phase_update) %] [% ELSIF ( phase_save) %] [% END %]
[% END %] [% IF ( enter_params ) %]
[% IF ( auth_val_error ) %]

Errors found when processing parameters for report: [% name %]

[% FOREACH auth_val_error IN auth_val_errors %]

[% auth_val_error.entry %]: The authorized value category ([% auth_val_error.auth_val %]) you selected does not exist.

[% END %]
[% ELSE %]

Enter parameters for report [% name %]:

[% IF ( notes ) %]

[% notes %]

[% END %]
    [% FOREACH sql_param IN sql_params %] [% IF sql_param.input == 'date' %]
  1. [% ELSIF ( sql_param.input == 'text' ) %]
  2. [% ELSE %]
  3. [% END %] [% END %]
[% END %]
[% END %] [% IF ( execute ) %]

[% name %]

[% IF ( notes ) %]

Notes: [% notes %]

[% END %] [% IF ( unlimited_total ) %]

Total number of results: [% unlimited_total %][% IF unlimited_total > limit %] ([% limit %] shown)[% END %].

[% END %]
[% FOREACH p IN sql_params %] [% END %]
[% pagination_bar %]
[% UNLESS ( errors ) %] [% FOREACH header_ro IN header_row %][% END %] [% FOREACH result IN results %] [% FOREACH cell IN result.cells %][% END %] [% END %]
[% header_ro.cell %]
[% cell.cell %]
[% END %] [% END %] [% IF ( create ) %]
Create report from SQL
  1. [% IF ( reportname ) %] [% ELSE %][% END %] Required
  2. [% PROCESS group_and_subgroup_selection %] [% IF (public) %]
  3. [% ELSE %]
  4. [% END %] [% IF (usecache) %]
  5. [% END %]
SQL:
Required
Cancel
[% END %] [% IF ( compound ) %]
Master:   Sub report:
[% END %] [% IF ( save_compound ) %] [% master %]
[% subsql %] [% END %] [% IF saved_results %]

Saved report results

[% name %]

[% notes %]

[% FOREACH rows IN saved_results %] [% FOREACH col IN rows %] [% END %] [% END %]
[% col %]
[% END %] [% IF ( showsql ) %]
[% reportname %]
    [% IF ( notes ) %]
  1. Notes: [% notes %]
  2. [% ELSE %][% END %]
[% END %] [% IF ( save_successful ) %] [% UNLESS ( errors ) %]

Your report "[% reportname %]" has been saved

[% END %] [% END %] [% IF ( editsql ) %]
Edit SQL report
  1. Required
  2. [% PROCESS group_and_subgroup_selection %] [% IF (public) %]
  3. [% ELSE %]
  4. [% END %] [% IF (usecache) %]
  5. [% END %]
SQL:
Required
Cancel
[% END %] [% IF ( errors ) %]
The following error was encountered:
[% FOREACH error IN errors %] [% IF ( error.sqlerr ) %]This report contains the SQL keyword [% error.sqlerr %].
Use of this keyword is not allowed in Koha reports due to security and data integrity risks. Only SELECT queries are allowed.
Please return to the "Saved Reports" screen and delete this report or retry creating a new one. [% ELSIF ( error.queryerr ) %]The database returned the following error:
[% error.queryerr %]
Please check the log for further details. [% ELSIF ( error.cache_expiry ) %]Please select a cache expiry less than 30 days. [% ELSE %] [% END %] [% END %]
[% END %]
[% IF ( saved1 ) %]

Filter

  1. [% INCLUDE 'date-format.inc' %]
Clear
[% END %] [% INCLUDE 'guided-reports-view.inc' %]
[% MACRO jsinclude BLOCK %] [% INCLUDE 'calendar.inc' %] [% IF ( saved1 ) %] [% INCLUDE 'datatables.inc' %] [% END %] [% END %] [% INCLUDE 'intranet-bottom.inc' %] [% BLOCK group_and_subgroup_selection %]
  • [% END %]