---
name: triage-report
description: Decide whether a Portwood bug report is a real code defect or a template-authoring problem, before any code is written. Use when a user reports "the PDF looks wrong", a merge tag didn't resolve, an image is missing, a chart is distorted, or output doesn't match the template. Most reports are template issues.
---
# Triaging a Portwood report
**Most reports are template issues, not code defects.** Work through this before
calling anything a bug. A report that turns out to be an authoring problem gets
answered as guidance and closed with the `template-help` label — it does not become
engineering work.
## Step 1 — Reproduce it
Do not skip to a diagnosis from the description. Get the template, the record, and
the output format. If you can't reproduce, ask for the template body and the
generated file before anything else.
The single most useful question to ask a reporter: **"Is the template HTML or DOCX?"**
It splits the decision tree in half.
## Step 2 — Rule out the template
These account for the majority of "it looks wrong" reports.
### CSS 3 in an HTML template
The PDF engine is `Blob.toPdf` → Flying Saucer, which is **CSS 2.1** plus a small
CSS 3 subset. These are **silently ignored** — the page renders, but layout collapses
to default block flow:
- `display: flex`, `display: grid`, `gap`
- `linear-gradient(...)` and other gradient functions
- `calc(...)`
- CSS custom properties / variables
- most CSS 3 layout features
Grep the template body first:
```bash
grep -nE "display:\s*(flex|grid)|gap:|linear-gradient|calc\(|var\(--" template.html
```
Any hit → template issue. The fix is `
`-based layout and solid colors.
### The `tbody` selector trap
`table > tbody > tr > td` silently matches nothing, because the parser's tree doesn't
have the implied `` the browser inserts. Use `td` attributes or class-only
selectors instead. A stylesheet that "does nothing" usually has one of these.
### A chart style the output format can't render
Charts work in **Word, PowerPoint, Excel, PDF and HTML** — but not every _style_ works
in every format, and the mismatch is silent. Check the style against the format before
calling it a bug:
| Style | Word / PPTX / XLSX | HTML → PDF | HTML in a browser |
| ---------------------------------------- | :----------------: | :----------: | :----------------------: |
| `bar` | ✅ PNG | ✅ CSS-bar | ✅ |
| `pivot` | ❌ | ✅ CSS table | ✅ |
| `clustered`, `stacked` | ✅ PNG | ✅ CSS table | ✅ |
| `column`, `pie`, `donut`, `line`, `area` | ✅ PNG | ❌ needs SVG | ✅ with `htmlRender=svg` |
Two rules explain the whole table:
- **Word / PowerPoint / Excel** get a rasterized PNG from `DocGenChartRasterizer`. Its
`KNOWN_STYLES` are `bar, column, pie, donut, stacked, clustered, line, area` —
**`pivot` is not among them**, because a cross-tab is a table, not a chart shape.
- **HTML → PDF** renders CSS-bar tables. `htmlRender=svg` produces inline `