報表

Koha 的報表是聚集資料的方法之一。報表用於產生統計、讀者清單、排架清單、或其他由資料庫產生的清單。

  • 到那: 更多 > 報表

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

報表精靈以六個步驟引導您建立報表。

步驟 1:選擇編輯報表的模組。就是決定資料來源的表單與欄位。

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

image881

說明

若系統管理已設定快取記憶您就有更多選擇。與公開報表有關。若把報表公開則需時時執行從而耗費系資料。設定此值可避免此現象。

image1292

步驟 2:選擇報表類型。目前,祗有 Tabular 可選。

image882

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.

image883

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.

image884

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

image885

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

image886

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.

image887

若選擇儲存報表,將詢問報表名稱、排序入的群組與次群組,以及必要的說明。

image888

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

image889

說明

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

可從這裡編輯、執行報表,或指定執行報表的時間。點選欄標題即可依欄位排列報表(建議以新增報表日期排序)。以左方的篩選器選單篩選報表,或依客戶群組分頁尋找報表。

來自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.

勾選主要報表模組的 『從 SQL 新增』 或 『儲存報表』 頁面上方的 『新增報表』 鈕,就能新增您的詢問。

image890

在顯現的表單填入資料

image891

  • 此 『名稱』 是顯示在儲存報表頁面,協助館員辨識報表之用。也可以用儲存報表頁面左方的篩選器搜尋它。

  • 您可以使用 『報表群組』 依羣組篩選您的報表。報表群組的設定在這裡 REPORT_GROUP 容許值類型或於新增報表時再點選 『或新增』 鈕。

    image1293

    設定於容許值範疇的報表羣組需要不重複的容許值及說明。

    • 說明

      以即時方式新增報表群組時,記得代碼不能超過10個字元且不能包括特殊字元或空格。

  • You can use 『Report subgroup』 to further organize your reports so that you can easily filter reports by groups and subgroups. Report subgroups are set in the REPORT_SUBGROUP authorized value category or can be added on the fly when creating the report by choosing the 『or create』 radio button. Report subgroups are set up with unique values in 『Authorised value』, and 『Description』. The 『Description (OPAC)』』 field needs to contain the authorised value for the report group that the subgroup falls under.

    image892

    • 說明

      以即時方式新增報表次群組時,記得代碼不能超過10個字元且不能包括特殊字元或空格。

  • 『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.

  • 『Notes』 will also appear on the saved reports page, this can be used to provide more details about the report or tips on how to enter values when it runs

  • 此時類型應該是 『表單式』 因為還未實施其他格式

  • 在 『SQL』 盒裡,鍵入或貼入 SQL 供報表使用

    說明

    若系統管理已設定快取記憶您就有更多選擇。與公開報表有關。若把報表公開則需時時執行從而耗費系資料。設定此值可避免此現象。

    image1294

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.

Report writing tips

Runtime parameters

若執行報表耗費過多資源時您可考慮使用執行參數。執行參數可以在執行報表前先篩選資料以節省系統資源。

Koha以特別的語法瞭解 『執行報表時取得該數據』。其語法為 <<Question to ask|authorized_value>>。

  • << 與 >> 祗是區隔符號。必須鍵入 << 於參數前並鍵入 >> 於結尾處

  • 把 『提問』 顯示在字串的左方。

  • The authorized_value can be omitted if not applicable. If it contains an authorized value category, 『branches』, 『itemtype』, 『categorycode』, 『biblio_framework』, a list with the Koha authorized values will be displayed instead of a free field.

備註

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

備註

在文字盒裡必須置入 「%」 其內容才算是 『空白』。否則,這樣的內容 「」 (空字串) 被視為空字串仍有內容。

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.

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

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

警告

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

說明

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

可以複製現在報表為新的報表。進入 『儲存報表』 頁面查看已有的報表。

image895

在報表右方有個 『動作』 下拉選單。按下並選擇 『複製』 鈕以現在的報表為基礎產生新報表。修改必要的 SQL 後成為新的報表。

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

image889

說明

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

點選欄位標題,讓報表依欄位排序,就能找到指定的報表。也可用左方的篩選器選單或分頁,依照客製化群組,找到指定的報表。

您可以從這個清單勾選報表右下角的 『動作』 鈕從彈出的選單裡選擇 『編輯』。

image897

將顯示編輯報表的表單。

image898

Running custom reports

儲存客製化報表後,可從儲存報表頁面勾選該報表右方的 『動作』 連結再點選 『執行』 它。

image899

執行報表時將被要求輸入若干值

image900

或直接看到結果

image901

從此結果裡,您可以點選上方的 『執行報表』,再執行報表;或點選 『編輯』 鈕,編輯報表;或點選 『新增』 鈕,重新建立報表。從結果下方選取檔案類型,選擇 『下載報表』 標籤,再選取 『下載』 ,就能下載您的結果。

說明

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

說明

可檢視的報表內容有限,建議使用 客製化報表 做為年度統計之用。

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

image902

選擇輸出至瀏覽器,您的結果將出現在螢幕。

image903

您可選擇匯出成檔案,供後續的使用。

產生報表時,必須選定計算或總結其值。

image904

選擇改變結果的總數,做為總支出的金額。

image905

Patron statistics

說明

可檢視的報表內容有限,建議使用 客製化報表 做為年度統計之用。

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

image906

選擇輸出至瀏覽器,您的結果將出現在螢幕。

image907

根據你的選擇,可在搜尋表單之上看到部份查詢資訊。也可選擇匯出至檔案再編輯成您的需要。

Catalog statistics

說明

可檢視的報表內容有限,建議使用 客製化報表 做為年度統計之用。

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

image908

選擇輸出至瀏覽器,您的結果將出現在螢幕。

image909

您可選擇匯出成檔案,供後續的使用。

Circulation statistics

說明

可檢視的報表內容有限,建議使用 客製化報表 做為年度統計之用。

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

image910

選擇輸出至瀏覽器,您的結果將出現在螢幕。

image911

您可選擇匯出成檔案,供後續的使用。

說明

為了對按月與逐日的流通有全盤瞭解,您可執行兩次報表,一次是 『借出』 的 『類型』 另一次是 『續借』。

此報表使用 『期間』,或日期篩選,允許您以每月第一天至次月第一天篩選。例如:10/1 至 11/1 做為十月份的統計。

  • 設定日期範圍,查看逐日統計。</br> 如:」從 XXX 開始至 XXX 結束的流通統計」。

  • 對一個月而言,如11/01/2009 至 12/01/2009

  • 對整年而言,如:01/01/2009 至 01/01/2010

  • 以一天而言,如: 11/15/2009 至 11/16/2009,會找到15日的流通紀錄

追蹤館內使用

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:

image912

Serials statistics

說明

可檢視的報表內容有限,建議使用 客製化報表 做為年度統計之用。

以提供的表單選擇系統內指定的期刊。

image913

選擇輸出至瀏覽器,您的結果將出現在螢幕。

image914

您可選擇匯出成檔案,供後續的使用。

Holds statistics

說明

可檢視的報表內容有限,建議使用 客製化報表 做為年度統計之用。

根據提供的統計資料,可以看到本館的預約數、滿足數、取消及其他統計。從選定的表單指定顯示的欄與列。也可用表單右方的篩選器,祗統計部份內容。

image915

選擇輸出至瀏覽器,您的結果將出現在螢幕。

image916

您可選擇匯出成檔案,供後續的使用。

借出最多的讀者

此報表將列出借出最多館藏的讀者。

image917

選擇輸出至瀏覽器,您的結果將出現在螢幕。

image918

您可選擇匯出成檔案,供後續的使用。

Most circulated items

此報表將列出被借出最多的館藏。

image919

選擇輸出至瀏覽器,您的結果將出現在螢幕。

image920

您可選擇匯出成檔案,供後續的使用。

無借出的讀者

此報表將列出不曾借出館藏的讀者。

image921

選擇輸出至瀏覽器,您的結果將出現在螢幕。

image922

您可選擇匯出成檔案,供後續的使用。

不曾借出的館藏

此報表將列出不曾借出的館藏。

image923

選擇輸出至瀏覽器,您的結果將出現在螢幕。

image924

您可選擇匯出成檔案,供後續的使用。

Catalog by item type

此報表列出每個分館各種資料類型的館藏總數。

image925

選擇輸出至瀏覽器,您的結果將出現在螢幕。

image926

您可選擇匯出成檔案,供後續的使用。

Lost items

此報表允許您產生系統內被標記為遺失的館藏清單

image927

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

List of currently available MARC modification templates

說明

  • 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

說明

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

Average loan time

此報表將依照您要求的類型列出館藏平均借出的時間:

image928

選擇輸出至瀏覽器,您的結果將出現在螢幕。

image929

您可選擇匯出成檔案,供後續的使用。

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.

步驟 1:給予此定義並提供必要的說明

image930

步驟2:選擇詢問的模組。

image931

步驟3:從顯示的表單裡選取詢問的欄位。

image932

步驟4:從欄位選取值。自動佈署於可用的資料庫。

image933

確認您的選項以便儲存此定義。

image934

您的定義將出現在報表字典頁面

image935

新增報表後,在下方的定義出現限制的選項,當成一般的篩選器。

image936