Changes between Version 1 and Version 2 of SubticketsPlugin/Reporting


Ignore:
Timestamp:
Nov 6, 2016, 9:05:52 PM (7 years ago)
Author:
Theodor Norup
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SubticketsPlugin/Reporting

    v1 v2  
    11[[TOC]]
    22
    3 The repository contains stored functions that can aid reporting of subticket hierarchies. Using such functions is necessary due to TracReports rewriting of SQL queries.
     3The plugin contains stored functions that can aid reporting of subticket hierarchies. Using such functions is necessary due to TracReports rewriting of SQL queries.
    44
    55The functions are found in the `reporting` [https://github.com/trac-hacks/trac-subtickets-plugin/tree/master/tracsubtickets/reportings subdirectory of the plugin code]
     6
     7Currently only PostgreSQL is supported. The query technique used is supported by at least MySql and SQLServer, but the DDLs differ slightly. Patches are welcome.
    68 
    79== Simple Example ==
     
    911The `tracsubticket_tree()` function returns a depth-first search of all tickets and subtickets. A simple report using that function is:
    1012
    11 {{{
     13{{{#!sql
     14SELECT
     15    r.id, path, parent, summary, component,
     16    CASE WHEN parent IS NULL
     17         THEN 'border-bottom:solid 3px #DDD;border-top: solid 3px #DDD;background-color:#DDD'   
     18         ELSE 'text-indent: ' ||10*level||'px'
     19         END AS __style__
     20FROM
     21    tracsubticket_tree() r
     22JOIN
     23    ticket t on r.id=t.id
     24ORDER BY path
    1225}}}
     26
     27The result of this report query looks like this:
     28
     29[[Image(tracsubtickets_simple_report)]]
     30
     31Thanks to [https://schneimi.wordpress.com/2013/02/02/trac-subticketsplugin-with-progress-bar-and-report/ schneimi] for the idea.