Changes between Version 1 and Version 2 of TracReports
- Timestamp:
- 01/23/07 01:33:03 (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracReports
v1 v2 6 6 7 7 Rather than have its own report definition format, TracReports relies on standard SQL 8 SELECT statements for custom report definition. 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 by 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.'' 9 18 10 19 A report consists of these basic parts: 11 * ID -- Unique (sequential) identifier 12 * Title -- Descriptive title 13 * Description -- A brief description of the report, in WikiFormatting text. 14 * Report Body -- List of results from report query, formatted according to the methods described below. 15 * Footer -- Links to alternative download formats for this report. 16 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. 17 25 18 26 == Changing Sort Order == … … 22 30 23 31 24 == Alternat e Download Formats ==25 Aside from the default HTML view, reports can also be exported in a number of alternat e formats.32 == Alternative Download Formats == 33 Aside from the default HTML view, reports can also be exported in a number of alternative formats. 26 34 At the bottom of the report page, you will find a list of available data formats. Click the desired link to 27 download the alternat e report format.35 download the alternative report format. 28 36 29 37 === Comma-delimited - CSV (Comma Separated Values) === 30 38 Export the report as plain text, each row on its own line, columns separated by a single comma (','). 31 '''Note:''' C olumn data is stripped from carriage returns, line feeds and commas to preservestructure.39 '''Note:''' Carriage returns, line feeds, and commas are stripped from column data to preserve the CSV structure. 32 40 33 41 === Tab-delimited === … … 35 43 36 44 === RSS - XML Content Syndication === 37 All reports support syndication using XML/RSS 2.0. To subscribe to a , click the the orange 'XML' icon at the bottom of the page. See TracRss for general information on RSS support in Trac. 38 39 ---- 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 40 49 == Creating Custom Reports == 41 50 … … 60 69 * reporter 61 70 * cc 62 * url63 71 * version 64 72 * milestone … … 103 111 }}} 104 112 113 To use multiple variables, separate them with an '&'. 114 115 Example: 116 {{{ 117 http://projects.edgewall.com/trac/reports/14?PRIORITY=high&SEVERITY=critical 118 }}} 119 105 120 106 121 === Special/Constant Variables === … … 140 155 141 156 === Custom formatting columns === 142 Columns whose names begin and end with 2 underscores (Example: ''' _''''''_color_''''''_''') are157 Columns whose names begin and end with 2 underscores (Example: '''`__color__`''') are 143 158 assumed to be ''formatting hints'', affecting the appearance of the row. 144 159 145 * ''' _''''''_group_''''''_''' -- Group results based on values in this column. Each group will have its own header and table.146 * ''' _''''''_color_''''''_''' -- Should be a numeric value ranging from 1 to 5 to select a pre-defined row color. Typically used to color rows by issue priority.147 * ''' _''''''_style_''''''_''' -- A custom CSS style expression to use for the current row.160 * '''`__group__`''' -- Group results based on values in this column. Each group will have its own header and table. 161 * '''`__color__`''' -- Should be a numeric value ranging from 1 to 5 to select a pre-defined row color. Typically used to color rows by issue priority. 162 * '''`__style__`''' -- A custom CSS style expression to use for the current row. 148 163 149 164 '''Example:''' ''List active tickets, grouped by milestone, colored by priority'' … … 167 182 also possible to create multi-line report entries. 168 183 169 * ''' column_''' -- ''Break row after this''. By appending an underscore ('_') to the column name, the remaining columns will be be continued on a second line.170 171 * ''' _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.172 173 * ''' _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).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). 174 189 175 190 '''Example:''' ''List active tickets, grouped by milestone, colored by priority, with description and multi-line layout'' … … 192 207 }}} 193 208 209 === Reporting on custom fields === 210 211 If you have added custom fields to your tickets (experimental feature in v0.8, see TracTicketsCustomFields), you can write a SQL query to cover them. You'll need to make a join on the ticket_custom table, but this isn't especially easy. 212 213 If you have tickets in the database ''before'' you declare the extra fields in trac.ini, there will be no associated data in the ticket_custom table. To get around this, use SQL's "LEFT OUTER JOIN" clauses. See TracIniReportCustomFieldSample for some examples. 194 214 195 215 ----