Changes between Version 1 and Version 2 of TracReports


Ignore:
Timestamp:
Apr 7, 2008, 11:15:27 AM (10 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracReports

    v1 v2  
    66
    77Rather 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.''
    918
    1019A 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.
    1725
    1826== Changing Sort Order ==
     
    2230
    2331
    24 == Alternate Download Formats ==
    25 Aside from the default HTML view, reports can also be exported in a number of alternate formats.
     32== Alternative Download Formats ==
     33Aside from the default HTML view, reports can also be exported in a number of alternative formats.
    2634At the bottom of the report page, you will find a list of available data formats. Click the desired link to
    27 download the alternate report format.
     35download the alternative report format.
    2836
    2937=== Comma-delimited - CSV (Comma Separated Values) ===
    3038Export the report as plain text, each row on its own line, columns separated by a single comma (',').
    31 '''Note:''' Column data is stripped from carriage returns, line feeds and commas to preserve structure.
     39'''Note:''' Carriage returns, line feeds, and commas are stripped from column data to preserve the CSV structure.
    3240
    3341=== Tab-delimited ===
     
    3543
    3644=== 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 ----
     45All 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
    4049== Creating Custom Reports ==
    4150
     
    6069 * reporter
    6170 * cc
    62  * url
    6371 * version
    6472 * milestone
     
    103111}}}
    104112
     113To use multiple variables, separate them with an '&'.
     114
     115Example:
     116{{{
     117 http://projects.edgewall.com/trac/reports/14?PRIORITY=high&SEVERITY=critical
     118}}}
     119
    105120
    106121=== Special/Constant Variables ===
     
    140155
    141156=== Custom formatting columns ===
    142 Columns whose names begin and end with 2 underscores (Example: '''_''''''_color_''''''_''') are
     157Columns whose names begin and end with 2 underscores (Example: '''`__color__`''') are
    143158assumed to be ''formatting hints'', affecting the appearance of the row.
    144159 
    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.
    148163
    149164'''Example:''' ''List active tickets, grouped by milestone, colored by priority''
     
    167182also possible to create multi-line report entries.
    168183
    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).
    174189
    175190'''Example:''' ''List active tickets, grouped by milestone, colored by priority, with  description and multi-line layout''
     
    192207}}}
    193208
     209=== Reporting on custom fields ===
     210
     211If 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
     213If 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.
    194214
    195215----