4 | | レポートモジュールは、簡単かつ強力なレポーティング機能を提供します。 |
5 | | この機能によって、 Trac データベースのチケット情報を取得することができます。 |
6 | | |
7 | | TracReports ではレポートの形式を定義するための方法として、独自フォーマットではなく、 |
8 | | SQL の SELECT 文を使用することにしました。 |
9 | | |
10 | | レポートは以下の基本的なパーツから構成されます: |
11 | | * ID -- ユニークな (連番の) 識別子 |
12 | | * レポート名 (Title) -- レポートのタイトル |
13 | | * 説明 (Description) -- WikiFormatting で記述された、レポートの説明。 |
14 | | * レポート本体 (Report Body) -- 後に述べるフォーマットで規定された、レポートクエリの結果。 |
15 | | * フッタ(Footer) -- レポート本体を異なる形式でダウンロードするためのリンク。 |
16 | | |
17 | | |
18 | | == ソートの並び順変更 == |
19 | | 単純なレポート (特にグループ化されていないもの) では、カラムのヘッダをクリックすれば、そのカラムでソートすることが出来ます。 |
20 | | |
21 | | カラムのヘッダがハイパーリンク (赤) になっていれば、クリックすることでそのカラムでのソートができます。並び順を逆にするには、もう一度クリックします。 |
22 | | |
23 | | |
24 | | == ダウンロードできるフォーマット == |
25 | | 通常表示される HTML でのビューの加え、レポートはいろいろな形式で使用することができます。 |
26 | | レポートページの一番下に、利用可能なデータ形式の一覧があります。望む形式のリンクをクリックすれば、 |
27 | | その形式でのレポートをダウンロードすることができます。 |
28 | | |
29 | | === カンマ区切りテキスト - CSV (Comma Separated Values) === |
30 | | 1レコードを1行として、各カラムをカンマ (',') で区切ったプレーンテキストとしてダウンロードできます。 |
31 | | '''Note:''' CSV形式を保つため、各カラムのデータに改行文字やカンマがある場合、その位置で切り取られます。 |
32 | | |
33 | | === タブ区切り === |
34 | | CSV と似ていますが、水平タブ文字 (\t) で区切られる点が違います。 |
| 4 | The Trac reports module provides a simple, yet powerful reporting facility |
| 5 | to present information about tickets in the Trac database. |
| 6 | |
| 7 | Rather than have its own report definition format, TracReports relies on standard SQL |
| 8 | `SELECT` statements for custom report definition. |
| 9 | |
| 10 | '''Note:''' ''The report module is being phased out in its current form because it seriously limits the ability of the Trac team to make adjustments to the underlying database schema. We believe that the [wiki:TracQuery query module] is a good replacement that provides more flexibility and better usability. While there are certain reports that cannot yet be handled by the query module, we intend to further enhance it so that at some point the reports module can be completely removed. This also means that there will be no major enhancements to the report module anymore.'' |
| 11 | |
| 12 | ''You can already completely replace the reports module by the query module simply be disabling the former in [wiki:TracIni trac.ini]:'' |
| 13 | {{{ |
| 14 | [components] |
| 15 | trac.ticket.report.* = disabled |
| 16 | }}} |
| 17 | ''This will make the query module the default handler for the “View Tickets” navigation item. We encourage you to try this configuration and report back what kind of features of reports you are missing, if any.'' |
| 18 | |
| 19 | A report consists of these basic parts: |
| 20 | * '''ID''' -- Unique (sequential) identifier |
| 21 | * '''Title''' -- Descriptive title |
| 22 | * '''Description''' -- A brief description of the report, in WikiFormatting text. |
| 23 | * '''Report Body''' -- List of results from report query, formatted according to the methods described below. |
| 24 | * '''Footer''' -- Links to alternative download formats for this report. |
| 25 | |
| 26 | == Changing Sort Order == |
| 27 | Simple reports - ungrouped reports to be specific - can be changed to be sorted by any column simply by clicking the column header. |
| 28 | |
| 29 | If a column header is a hyperlink (red), click the column you would like to sort by. Clicking the same header again reverses the order. |
| 30 | |
| 31 | |
| 32 | == Alternate Download Formats == |
| 33 | Aside from the default HTML view, reports can also be exported in a number of alternate formats. |
| 34 | At the bottom of the report page, you will find a list of available data formats. Click the desired link to |
| 35 | download the alternate report format. |
| 36 | |
| 37 | === Comma-delimited - CSV (Comma Separated Values) === |
| 38 | Export the report as plain text, each row on its own line, columns separated by a single comma (','). |
| 39 | '''Note:''' Carriage returns, line feeds, and commas are stripped from column data to preserve the CSV structure. |
| 40 | |
| 41 | === Tab-delimited === |
| 42 | Like above, but uses tabs (\t) instead of comma. |
37 | | 全てのレポートは、 XML/RSS 2.0 での配信をサポートしています。購読するにはページ下部にある、オレンジ色の 'XML' アイコンをクリックしてください。 Trac での RSS サポートについての一般的な情報は、 TracRss に記述しています。 |
38 | | |
39 | | ---- |
40 | | == カスタムレポートを作成する == |
41 | | |
42 | | ''カスタムレポートを作成するためには、 SQL を楽に書ける程度の知識が必要です。'' |
43 | | |
44 | | レポートは基本的に、 Trac が実行できる形式の、名前がついた特定 SQL です。 |
45 | | レポートに指定された SQL は、直接 Web インタフェースから閲覧したり、 |
46 | | 作成したりできます。 |
47 | | |
48 | | 通常のレポートは、 'ticket' 表に対する、カラムの選択や、ソート指定を伴った |
49 | | SELECT 文となります。 |
50 | | |
51 | | == Ticket 表のカラム == |
52 | | ''ticket'' 表は、以下のカラムを持ちます: |
53 | | * id -- チケットID |
54 | | * time -- 登録日時 |
55 | | * changetime -- 最終更新日時 |
56 | | * component -- コンポーネント |
57 | | * severity -- 重要度 |
58 | | * priority -- 優先度 |
59 | | * owner -- 担当者 |
60 | | * reporter -- 報告者 |
61 | | * cc -- 関係者 |
62 | | * url -- URL |
63 | | * version -- バージョン |
64 | | * milestone -- マイルストーン |
65 | | * status -- ステータス |
66 | | * resolution -- 解決方法 |
67 | | * summary -- チケットの概要 |
68 | | * description -- チケットについての完全な説明 |
69 | | |
70 | | 各カラムに対応する属性の詳細な説明は、 TracTickets に記述しています。 |
71 | | |
72 | | '''優先度順、登録日時順の全未解決チケット''' |
73 | | |
74 | | '''例:''' ''優先度順、登録日時順の全未解決チケット'' |
| 45 | All reports support syndication using XML/RSS 2.0. To subscribe to an RSS feed, click the orange 'XML' icon at the bottom of the page. See TracRss for general information on RSS support in Trac. |
| 46 | |
| 47 | ---- |
| 48 | |
| 49 | == Creating Custom Reports == |
| 50 | |
| 51 | ''Creating a custom report requires a comfortable knowledge of SQL.'' |
| 52 | |
| 53 | A report is basically a single named SQL query, executed and presented by |
| 54 | Trac. Reports can be viewed and created from a custom SQL expression directly |
| 55 | in from the web interface. |
| 56 | |
| 57 | Typically, a report consists of a SELECT-expression from the 'ticket' table, |
| 58 | using the available columns and sorting the way you want it. |
| 59 | |
| 60 | == Ticket columns == |
| 61 | The ''ticket'' table has the following columns: |
| 62 | * id |
| 63 | * time |
| 64 | * changetime |
| 65 | * component |
| 66 | * severity |
| 67 | * priority |
| 68 | * owner |
| 69 | * reporter |
| 70 | * cc |
| 71 | * version |
| 72 | * milestone |
| 73 | * status |
| 74 | * resolution |
| 75 | * summary |
| 76 | * description |
| 77 | |
| 78 | See TracTickets for a detailed description of the column fields. |
| 79 | |
| 80 | '''all active tickets, sorted by priority and time''' |
| 81 | |
| 82 | '''Example:''' ''All active tickets, sorted by priority and time'' |
120 | | == 上級トピック: 表示形式のカスタマイズ == |
121 | | Trac には、レイアウトのカスタマイズや、グルーピング、ユーザ定義の CSS 利用などによる |
122 | | もっと複雑なレポートの作成も可能です。このようなレポートを作成するには、 |
123 | | Trac のレポートエンジンが出力を制御するためのステートメントを含む、特別な SQL を使用します。 |
124 | | |
125 | | == 特別なカラム == |
126 | | レポートを整形するため、 TracReports はクエリの結果から '特定の' カラム名を |
127 | | 探します。このような '特定の' 名前で、最終的なレポートのレイアウトやスタイルが |
128 | | 処理され、変更されます。 |
129 | | |
130 | | === 自動的に整形されるカラム名 === |
131 | | * '''ticket''' -- チケットの ID が入っているカラムで使用します。該当する ID のカラムにハイパーリンクされます。 |
132 | | * '''created, modified, date, time''' -- 日付や時刻に整形されます。 |
133 | | |
134 | | * '''description''' -- チケットの説明が入っているカラムで使用します。 Wiki エンジンで処理されます。 |
135 | | |
136 | | '''例:''' |
| 135 | == Advanced Reports: Custom Formatting == |
| 136 | Trac is also capable of more advanced reports, including custom layouts, |
| 137 | result grouping and user-defined CSS styles. To create such reports, we'll use |
| 138 | specialized SQL statements to control the output of the Trac report engine. |
| 139 | |
| 140 | == Special Columns == |
| 141 | To format reports, TracReports looks for 'magic' column names in the query |
| 142 | result. These 'magic' names are processed and affect the layout and style of the |
| 143 | final report. |
| 144 | |
| 145 | === Automatically formatted columns === |
| 146 | * '''ticket''' -- Ticket ID number. Becomes a hyperlink to that ticket. |
| 147 | * '''created, modified, date, time''' -- Format cell as a date and/or time. |
| 148 | |
| 149 | * '''description''' -- Ticket description field, parsed through the wiki engine. |
| 150 | |
| 151 | '''Example:''' |
161 | | '''Note:''' ''ticket'' 表の優先度に対応する数値は、 ''enum'' 表を結合することで |
162 | | 取り出しています。 |
163 | | |
164 | | === 行単位のレイアウト変更 === |
165 | | デフォルトでは、全てのカラムで1行を使い、上記の指定がされていれば、 |
166 | | フォーマットされた形式で HTML に表示されます。それだけでなく、 |
167 | | これから挙げる指定によって、複数行にわたってのレイアウトを行うことができます。 |
168 | | |
169 | | * '''column_''' -- ''改行''。 カラム名の語尾にアンダースコア ('_') を付与した場合、以降のカラムは次の行で表示されます。 |
170 | | |
171 | | * '''_column_''' -- ''全行表示''。 カラム名の前後にアンダースコア ('_') を付与した場合、そのカラムは続く行で全てのカラム幅を使って表示されます。 |
172 | | |
173 | | * '''_column''' -- ''データを非表示にする''。 カラム名の語頭にアンダースコア ('_') を付与した場合、 HTML 出力では非表示になります。これは (CSV や RSS のような) 別フォーマットでのダウンロード時にだけ見たい情報であるときに使います。 |
174 | | |
175 | | '''例:''' ''アクティブなチケットを、マイルストーンでグループ化し、優先度で色付け、チケットの説明を multi-line レイアウトでリスト表示する'' |
| 176 | '''Note:''' A table join is used to match ''ticket'' priorities with their |
| 177 | numeric representation from the ''enum'' table. |
| 178 | |
| 179 | === Changing layout of report rows === |
| 180 | By default, all columns on each row are display on a single row in the HTML |
| 181 | report, possibly formatted according to the descriptions above. However, it's |
| 182 | also possible to create multi-line report entries. |
| 183 | |
| 184 | * '''column_''' -- ''Break row after this''. By appending an underscore ('_') to the column name, the remaining columns will be be continued on a second line. |
| 185 | |
| 186 | * '''_column_''' -- ''Full row''. By adding an underscore ('_') both at the beginning and the end of a column name, the data will be shown on a separate row. |
| 187 | |
| 188 | * '''_column''' -- ''Hide data''. Prepending an underscore ('_') to a column name instructs Trac to hide the contents from the HTML output. This is useful for information to be visible only if downloaded in other formats (like CSV or RSS/XML). |
| 189 | |
| 190 | '''Example:''' ''List active tickets, grouped by milestone, colored by priority, with description and multi-line layout'' |