Edgewall Software

Changes between Initial Version and Version 1 of TracReports


Ignore:
Timestamp:
Mar 2, 2004, 3:15:15 AM (20 years ago)
Author:
daniel
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TracReports

    v1 v1  
     1= Trac Reports =
     2The Trac reports module provides a simple, yet powerful reporting facility
     3for presenting information about tickets from the Trac database.
     4
     5== Creating Custom Reports ==
     6
     7Creating a custom report requires knowing and using the SQL query language.
     8
     9A report is basically a single named SQL query, executed and presented by
     10Trac.  Reports can be viewed and created from a custom SQL expression directly
     11in from the web interface.
     12
     13Typically, a report consists of a SELECT-expression from the 'ticket' table,
     14using the available columns and sorting the way you want it.
     15
     16== Ticket columns ==
     17The '''ticket'' table has the following columns:
     18 * id
     19 * time
     20 * changetime
     21 * component
     22 * severity 
     23 * priority
     24 * owner
     25 * reporter
     26 * cc
     27 * url
     28 * version -- Version of the project does this ticket pertains to.
     29 * milestone
     30 * status
     31 * resolution
     32 * summary
     33 * description
     34
     35See TracTickets for a detailed description of the column fields.
     36
     37== Special Columns ==
     38To format the report properly, Trac needs to know the meaning of some result
     39columns . This is a list of column names of special meaning to Trac:
     40 * '''ticket''' -- Ticket ID number. Will become a hyperlink to that ticket.
     41
     42''Note: In upcoming releases, there will be more special columns added, to create color-coded reports, grouping and other nifty features.''
     43
     44
     45
     46== Sample Reports ==
     47'''status and summary for all tickets'''
     48
     49{{{
     50SELECT id as ticket, status, summary FROM ticket
     51}}}
     52
     53----
     54'''all active tickets, sorted by priority and time'''
     55
     56{{{
     57SELECT id AS ticket, status, severity, priority, owner,
     58       time as created, summary FROM ticket
     59  WHERE status IN ('new', 'assigned', 'reopened')
     60  ORDER BY priority, time
     61}}}
     62
     63----
     64'''active tickets, grouped by milestone and sorted by priority'''
     65
     66{{{
     67SELECT id AS ticket, milestone, status, severity,
     68       priority, component, owner, summary
     69  FROM ticket
     70  WHERE status IN ('new', 'assigned', 'reopened')
     71  ORDER BY milestone,
     72    (CASE priority
     73      WHEN 'highest' THEN 0
     74      WHEN 'high' THEN 1
     75      WHEN 'normal' THEN 2
     76      WHEN 'low' THEN 3
     77      ELSE 4
     78    END), severity, time
     79}}}
     80
     81
     82See also: TracTickets, TracGuide