Rather than have its own report definition format, TracReports relies on standard SQL

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 be 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.''

18

19

A report consists of these basic parts:

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.

'''Note:''' A table join is used to match ''ticket'' priorities with their

177

numeric representation from the ''enum'' table.

178

179

=== Changing layout of report rows ===

180

By default, all columns on each row are display on a single row in the HTML

181

report, possibly formatted according to the descriptions above. However, it's

182

also possible to create multi-line report entries.

183

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).

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.