Ticket #2645 (new defect)
Report custom formatting: font styles not honored
| Reported by: | kilian.cavalotti@… | Owned by: | daniel |
|---|---|---|---|
| Priority: | lowest | Milestone: | 2.0 |
| Component: | report system | Version: | 0.9.3 |
| Severity: | normal | Keywords: | style report font |
| Cc: | whueskes@… |
Description
I have a problem with reports custom formatting: when using style to change font properties, the specified style is not applied. The following example, given in TracReports, illustrates the problem :
SELECT p.value AS __color__,
t.milestone AS __group__,
(CASE owner WHEN '$USER' THEN 'font-weight: bold; background: red;' ELSE
'' END) AS __style__,
t.id AS ticket, summary
FROM ticket t,enum p
WHERE t.status IN ('new', 'assigned', 'reopened')
AND p.name=t.priority AND p.type='priority'
ORDER BY t.milestone, p.value, t.severity, t.time
Using this report, I correctly see my tickets with a red background, but the font weight is normal. I assume that's because the style="font-weight:bold" attribute is passed to the <tr> tag, when it should probably be passed to each <td> element.
With
(CASE owner WHEN '$USER' THEN 'font-weight: bold;' ELSE '' END) AS __style__,
the generated HTML looks like below:
<tr class="color2-odd" style="font-weight: bold;">
<td class="ticket">
<a title="View ticket" href="/trac/ticket/52"> #52 </a>
</td>
<td class="component"> trac </td>
<td class="status"> new </td>
<td class="type"> task </td>
<td class="priority"> high </td>
<td class="severity"> normal </td>
<td class="owner"> kilian </td>
<td class="date"> 01/17/06 </td>
</tr>
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


