Koha How-To

Monday Minutes: Adding an ALL option for Reports

Adding the ALL in Reports

This enhancement adds the ability to optionally include an `all` option in a report when using filter selectable lists. Jessie and Kelly walk through this new ability in the reports module.

Changing the mySQL

If you have a report that includes a WHERE statement that pulls a list of options from Koha, the ability add an ALL option is now available. Here are two examples Kelly and Jessie showed during the tutorial video above.

Original mySQL:

SELECT branchname

FROM branches

WHERE branchcode = <<Branch|braches>>

This will give the user the ability to choose one branch from the dropdown. Alternatively, now if the need to have the choice to include all the branches ( in this example), the mySQL would change to look like this:

SELECT branchname

FROM branches

WHERE branchcode LIKE <<Branch|branches:all>>

The two changes are replacing the equal (=) sign in the WHERE statement with a LIKE and including :all after the second value between the hungry alligators.

Another mySQL example

Before mySQL:

SELECT barcode, itemnumber, biblionumber, location

FROM items

WHERE location=<<LOCATION|loc>>

Now changing the WHERE statement, the mySQL will look like this:

SELECT barcode, itemnumber, biblionumber, location

FROM items

WHERE location LIKE <<LOCATION|loc:all>>

Want More Report Tutorials

Here are some more blog posts and tutorial videos about the Koha Reports Module:

Reporting on Deleted Records

Writing Reports is as easy as ordering a cup of coffee!

Monday Minutes : Editing a SQL report

Creating a Report for your Library using the Koha Report Wiki