bug 7249 follow-up, online help
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / help / reports / guided_reports.tt
1 [% INCLUDE 'help-top.inc' %]
2
3 <h1>Add a Custom Report</h1>
4
5 <h2>Guided Report Wizard</h2>
6
7 <p>If the report you need is not already available, the 'Guided Reports' Wizard will walk you through creating a custom report.</p>
8
9 <ul>
10 <li>Go to the 'Reports' module (usually under 'More' in your Global Nav)</li>
11 <li>Choose 'Guided Reports' under 'Guided Reports Wizard'</li>
12 </ul>
13
14 <p>Answer the 6 questions presented in order to create your report.</p>
15
16 <p><strong>Step 1: Choose a Module to Report on</strong></p>
17
18 <ul>
19 <li>Choose a Koha module to build a report on (patrons, circ, cataloging, etc)</li>
20 <li>Click 'Next'</li>
21 </ul>
22
23 <p><strong>Step 2: Pick a Report Type</strong></p>
24
25 <ul><li style="color: #990000">IMPORTANT: Only Tabular should be chosen with this option</li></ul>
26
27 <p><strong>Step 3: Select Columns for Display</strong></p>
28
29 <p><strong>Step 4: Select Criteria to Limit</strong></p>
30
31 <ul><li>This is optional, if you don't want to limit results by any one field, just leave this section blank.</li></ul>
32
33 <p><strong>Step 5: Pick which columns to perform mathmatical functions on</strong></p>
34
35 <ul><li>This is optional, if you don't want to do any math on the results, just leave this section blank.</li></ul>
36
37 <p><strong>Step 6: Choose how you want the report ordered</strong></p>
38
39 <ul><li>This is optional, if you want the results to come out as they are in the table, just leave this section blank.</li></ul>
40
41 <h1>Edit Reports</h1>
42
43 <p>Custom reports can be edited in their entirety from the Saved Guided Reports page.</p>
44
45 <ul><li><em>Get there:</em> More > Reports > Guided Reports > Use Saved</li></ul>
46
47 <ul>
48 <li>To edit a report click 'Edit SQL' beside 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>
50 </ul>
51
52 <h2>Report from SQL</h2>
53
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
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
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 &lt;&lt;Question to ask|authorized_value&gt;&gt;.</li>
68     <li>The &lt;&lt; and &gt;&gt; are just delimiters. You must put &lt;&lt; at the beginning and &gt;&gt; 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=&lt;&lt;Enter title&gt;&gt;" will display results with title='' (no title). If you want to have to have something not mandatory, use "title like &lt;&lt;Enter title&gt;&gt;" and enter a % at run time instead of nothing</li>
71 </ul>
72
73 <p>Examples:</p>
74
75 <ul>
76     <li>SELECT surname, firstname<br />
77     FROM borrowers<br />
78     WHERE branchcode=&lt;&lt;Enter patrons library|branches&gt;&gt; AND surname like &lt;&lt;Enter filter for patron surname (% if none)&gt;&gt;</li>
79     <li>SELECT *<br />
80     FROM items<br />
81     WHERE homebranch = &lt;&lt;Pick your branch|branches&gt;&gt; and barcode like &lt;&lt;Partial barcode value here (use % for wildcard)&gt;&gt;</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: &lt;&lt;Enter Date|date&gt;&gt;</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 &lt;&lt;Branch|branches&gt;&gt;</li>
87 </ul>
88
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>
90
91 <h1>Questions</h1>
92
93 <p><strong>What are duration and visibility?</strong></p>
94 <p>The duration field may be visible or not, don't worry if you don't see it. If you see it, it says how long a report run is kept in Koha and, any subsequent re-run will in fact display the result run the 1st time</p>
95 <p>The visibility field specify if your report is accessible <strong>without authentication</strong> from the OPAC. Reports can be retrieved from the following URLs:
96 <ul><li> opac: http://localhost/cgi-bin/koha/svc/report?id=1</li>
97 <li>intranet: http://localhost:8080/cgi-bin/koha/svc/report?id=1</li>
98 </ul>
99 <p>(replace localhost and localhost:8080 with the appropriate URLs)</p>
100
101 <p><strong>Is there a repository for reports?</strong></p>
102
103 <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>
104
105 <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>
106
107 <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>
108
109 [% INCLUDE 'help-bottom.inc' %]