Changes between Version 1 and Version 2 of SubticketsPlugin/Reporting
- Timestamp:
- Nov 6, 2016, 9:05:52 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SubticketsPlugin/Reporting
v1 v2 1 1 [[TOC]] 2 2 3 The repositorycontains stored functions that can aid reporting of subticket hierarchies. Using such functions is necessary due to TracReports rewriting of SQL queries.3 The plugin contains stored functions that can aid reporting of subticket hierarchies. Using such functions is necessary due to TracReports rewriting of SQL queries. 4 4 5 5 The functions are found in the `reporting` [https://github.com/trac-hacks/trac-subtickets-plugin/tree/master/tracsubtickets/reportings subdirectory of the plugin code] 6 7 Currently only PostgreSQL is supported. The query technique used is supported by at least MySql and SQLServer, but the DDLs differ slightly. Patches are welcome. 6 8 7 9 == Simple Example == … … 9 11 The `tracsubticket_tree()` function returns a depth-first search of all tickets and subtickets. A simple report using that function is: 10 12 11 {{{ 13 {{{#!sql 14 SELECT 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__ 20 FROM 21 tracsubticket_tree() r 22 JOIN 23 ticket t on r.id=t.id 24 ORDER BY path 12 25 }}} 26 27 The result of this report query looks like this: 28 29 [[Image(tracsubtickets_simple_report)]] 30 31 Thanks to [https://schneimi.wordpress.com/2013/02/02/trac-subticketsplugin-with-progress-bar-and-report/ schneimi] for the idea.