Lines 2-7
Link Here
|
2 |
|
2 |
|
3 |
<h1>Add a Custom Report</h1> |
3 |
<h1>Add a Custom Report</h1> |
4 |
|
4 |
|
|
|
5 |
<h2>Guided Report Wizard</h2> |
6 |
|
5 |
<p>If the report you need is not already available, the 'Guided Reports' Wizard will walk you through creating a custom report.</p> |
7 |
<p>If the report you need is not already available, the 'Guided Reports' Wizard will walk you through creating a custom report.</p> |
6 |
|
8 |
|
7 |
<ul> |
9 |
<ul> |
Lines 47-78
Link Here
|
47 |
<li>A page with editable fields will open so that you can change the title, notes and SQL related to the report</li> |
49 |
<li>A page with editable fields will open so that you can change the title, notes and SQL related to the report</li> |
48 |
</ul> |
50 |
</ul> |
49 |
|
51 |
|
50 |
<h1>Questions</h1> |
52 |
<h2>Report from SQL</h2> |
51 |
|
|
|
52 |
<p><strong>Is there a repository for reports?</strong></p> |
53 |
|
53 |
|
54 |
<p>There is a page on the Koha Wiki: <a href="http://wiki.koha-community.org/wiki/SQL_Reports_Library" target="_new">http://wiki.koha-community.org/wiki/SQL_Reports_Library</a> with reports written by Koha libraries around the world.</p> |
54 |
<p>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: <a href="http://wiki.koha-community.org/wiki/SQL_Reports_Library">http://wiki.koha-community.org/wiki/SQL_Reports_Library</a>. You can also find your database structure in /installer/data/mysql/kohastructure.sql or online at: <a href="http://schema.koha-community.org">http://schema.koha-community.org</a>.</p> |
55 |
|
55 |
|
56 |
<p>NEKLS also has a great page (<a href="http://www.nexpresslibrary.org/training/reports-training/" target="_new">http://www.nexpresslibrary.org/training/reports-training/</a>) with a list of reports they have written.</p> |
56 |
<p>To add your query, click the link to 'Create from SQL' on the main reports module or the New button at the top of the Saved Reports page.</p> |
57 |
|
57 |
|
58 |
<p><strong>Can I have run-time defined parameters?</strong></p> |
58 |
<p>Fill in the form presented</p> |
|
|
59 |
<ul> |
60 |
<li>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 the left of the Saved Reports page.</li> |
61 |
<li>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</li> |
62 |
<li>The type should always be 'Tabular' at this time since the other formats have not been implemented</li> |
63 |
<li>In the SQL box you will type or paste the SQL for the report</li> |
64 |
<li>If you feel that your report might be too resource intensive you might want to consider using runtime parameters to your query. Runtime parameters basically make a filter appear before the report is run to save your system resources. |
65 |
<ul> |
66 |
<li><strong>Note:</strong> 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.</li> |
67 |
<li>There is a specific syntax that Koha will understand as 'ask for values when running the report'. The syntax is <<Question to ask|authorized_value>>.</li> |
68 |
<li>The << and >> are just delimiters. You must put << at the beginning and >> at the end of your parameter</li> |
69 |
<li>The 'Question to ask' will be displayed on the left of the string to enter.</li> |
70 |
<li>The authorized_value can be omitted if not applicable. If it contains an authorized value category, or branches or itemtype or categorycode, a list with the Koha authorized values will be displayed instead of a free field Note that you can have more than one parameter in a given SQL Note that entering nothing at run time won't probably work as you expect. It will be considered as "value empty" not as "ignore this parameter". 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</li> |
71 |
</ul> |
59 |
|
72 |
|
60 |
<p>Yes, you can: there is a specific syntax that Koha will understand as 'ask for values when running the report'. The syntax is <<Question to ask|authorised_value>>.</p> |
73 |
<p>Examples:</p> |
61 |
|
74 |
|
62 |
<ul> |
75 |
<ul> |
63 |
<li>The << and >> are just delimiters. You must put << at the beginning and >> at the end of your parameter</li> |
76 |
<li>SELECT surname, firstname<br /> |
64 |
<li>The <strong>Question to ask</strong> will be displayed on the left of the string to enter. |
77 |
FROM borrowers<br /> |
65 |
<li>The <strong>authorised_value</strong> can be omitted if not applicable. If it contains an authorised value category, or <strong>branches</strong> or <strong>itemtype</strong> or <strong>categorycode</strong>, a list with the Koha authorised values will be displayed instead of a free field. If the authorised value is <strong>date</strong>, a date selector button will be added after the input field</li> |
78 |
WHERE branchcode=<<Enter patrons library|branches>> AND surname like <<Enter filter for patron surname (% if none)>></li> |
|
|
79 |
<li>SELECT *<br /> |
80 |
FROM items<br /> |
81 |
WHERE homebranch = <<Pick your branch|branches>> and barcode like <<Partial barcode value here (use % for wildcard)>></li> |
82 |
</ul> |
83 |
</li> |
84 |
<li style="background-color: #ffe599;">Tip: To generate a date picker calendar to the right of the field when running a report you can use the 'date' keyword like this: <<Enter Date|date>></li> |
85 |
<li style="background-color: #ffe599;">Tip: You have to put "%" in a text box to 'leave it blank'. Otherwise, it literally looks for "" (empty string) as the value for the field.</li> |
86 |
<li style="color: #990000;">Important: In addition to using any authorized value code to generate a dropdown, you can use the following values as well: Branches (branches), Item Types (itemtypes) and Patron Categories (categorycode). For example a branch pull down would be generated like this <<Branch|branches>></li> |
66 |
</ul> |
87 |
</ul> |
67 |
|
88 |
|
68 |
<p>Note that you can have more than one parameter in a given SQL</p> |
89 |
<p>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.</p> |
69 |
|
90 |
|
70 |
<p>Note that entering nothing at run time won't probably work as you expect. It will be considered as "value empty" not as "ignore this parameter". 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</p> |
91 |
<h1>Questions</h1> |
71 |
|
92 |
|
72 |
<p>Sample :</p> |
93 |
<p><strong>Is there a repository for reports?</strong></p> |
73 |
|
94 |
|
74 |
<ul><li>SELECT surname,firstname FROM borrowers WHERE branchcode=<<Enter patrons library|branches>> AND surname like <<Enter filter for patron surname (% if none)>></li></ul> |
95 |
<p>There is a page on the Koha Wiki: <a href="http://wiki.koha-community.org/wiki/SQL_Reports_Library" target="_new">http://wiki.koha-community.org/wiki/SQL_Reports_Library</a> with reports written by Koha libraries around the world.</p> |
|
|
96 |
|
97 |
<p>NEKLS also has a great page (<a href="http://www.nexpresslibrary.org/training/reports-training/" target="_new">http://www.nexpresslibrary.org/training/reports-training/</a>) with a list of reports they have written.</p> |
75 |
|
98 |
|
76 |
<p><strong>See the full documentation for Custom Reports in the <a href="http://manual.koha-community.org/3.6/en/reports.html#customreports">manual</a> (online).</strong></p> |
99 |
<p><strong>See the full documentation for Custom Reports in the <a href="http://manual.koha-community.org/3.8/en/reports.html#customreports">manual</a> (online).</strong></p> |
77 |
|
100 |
|
78 |
[% INCLUDE 'help-bottom.inc' %] |
101 |
[% INCLUDE 'help-bottom.inc' %] |