[% INCLUDE 'help-top.inc' %]

Add a custom report

Guided report wizard

The guided report wizard will walk you through a six step process to generate a report.

Step 1: Choose the module you want to report on. This will determine what tables and fields are available for you to query.

'Report is public' should be left to the default of 'No' in most cases. A report can be made public if you intend to allow access to it through the JSON webservice interface. This is a system that can be used by developers to make custom presentations of the data from the report, for example displaying it using a graphing API. To learn more speak to your local developer.

Step 2: Choose a report type. For now, Tabular is the only option available.

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.

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 making an option.

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

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.

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 'Save' or copy the SQL and make edits to it by hand.

If you choose to save the report you will be asked to name your report, sort it in to groups and subgroups and enter any notes regarding it.

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

From here you can make edits, run the report, or schedule a time to have the report run. To find the report you created you can sort by any of the columns by clicking the on the column header (creation date is the best bet for finding 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 from 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 or the 'New report' button at the top of the 'Saved reports' page.

Fill in the form presented

Note: There is a limit of 10,000 records put on SQL statements entered in Koha. To get around this you want to add 'LIMIT 100000' to the end of your SQL statement (or any other number above 10,000.

Once everything is entered click the 'Save Report' button and you'll be presented with options to run it. Once a report is saved you do not have to recreate it you can simply find it on the Saved Reports page and run or edit it.

Duplicate Report

Reports can also be added by duplicating an existing report. Visit the 'Saved reports' page to see all of the reports listed on your system.

To the right of every report there is an 'Actions' pull down. Clickin that and choose 'Duplicate' to use an existing report as the basis for your new report. That will populate the new report form with the existing SQL for easy editing and resaving.

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.'

To find the report you'd like to edit you can sort by any of the columns by clicking the on the column header. 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.

From this list you can edit any custom report by clicking 'Actions' to the right of the report and choosing 'Edit' from the menu that appears.

The form to edit the report will appear.

Running Custom Reports

Once custom reports are saved to Koha, you can run them by going to the Saved Reports page and clicking the 'Actions' button to the right of the report and choosing 'Run'.

When you report runs you will either be asked for some values or you will see the results right away

From the results you can choose to rerun the report by clicking 'Run report' at the top, edit the report by clicking the 'Edit' button or starting over and creating a new report by using the 'New' button. You can also download your results by choosing a file type at the bottom of the results next to the 'Download the report' label and clicking 'Download.'

Tip: A Comma Separated Text file is a CSV file and it can be opened by any spreadsheet application.

DB table value for reports

Question: What do the codes in the accounttype field in the accountlines table stand for?

Answer:

Question: What are the possible codes for the type field in the statistics table?

Answer:

Question: What are the possible codes for the found field in the reserves and old_reserves tables?

Answer:

Question: What are the possible codes for the area field in the reports_dictionary table?

Answer:

Question: What are the possible codes for the message_type field in the messages table?

Answer:

Question: What are the possible codes for the status field in the serial table?

Answer:

See the full documentation for Custom Reports in the manual (online).

[% INCLUDE 'help-bottom.inc' %]