Tests Custom Reports

Custom Report Troubleshooting

A handler missing from the Handler list has a different Test ID; "Unexpected token" means object spread, ?. or ??; blank values are misspelled or missing variables; a page that splits in the PDF has content taller than A4.

Published 2026/10/15

Most problems show up in the handler editor: Output: Data shows what the function returned and Output: Report shows the rendered HTML. Test with several saved sample inputs before looking further.

Setup

SymptomCauseFix
The handler is not in the custom report's Handler list.The handler's Test ID is not this test's ID.Set the handler's Test ID to the test's ID.
The custom report is not offered in a step.The step lists the custom reports of the test it delivers.Create the custom report on that test (Reporting › Template).

Function errors

MessageCauseFix
The code must have only a single Function DeclarationHelper functions or other code outside anonymous.Move helpers inside anonymous.
Function's name must be 'anonymous' / The code is not a Function DeclarationA differently named function, or const f = (data) => ….Use function anonymous(data) { … }.
Function cannot be asyncasync function anonymous.Remove async; the function must be synchronous.
Unexpected token ... / . / ?Object spread, ?. or ??.See Supported syntax.
… could not be clonedThe returned object contains a function or class instance.Return plain data only.
Script execution timed outA loop that never ends, or very heavy work.Simplify; each run is limited to 5 seconds.
Cannot read properties of undefinedA field that may be missing (result, ticket, normy, testReporting) was not guarded.Check it first: data.normy && data.normy.normativeResult.

Template output

SymptomCauseFix
HTML tags show as text.Output is escaped by default.Use | safe for HTML you wrote — never for candidate text.
A value is blank.A misspelled variable or missing data — missing values print as empty.Compare the name with Output: Data; add | default("—").
Percentile or sten is empty in some places.The delivery has no benchmark, or the output doesn't include one.Guard data.normy and show a fallback.
Pass/fail or level differs from the Standard report.Unrounded percentage, or the pass mark read as a percentage.Round the percentage; pass.min.score is 0–1. See Recipes.
The app's styles look different inside the report.The report is isolated and inherits nothing.Declare fonts and base styles in the template.

Print and PDF

SymptomCauseFix
A page splits across two sheets in the PDF, or is cut off in Print.The page's content is taller than A4 — often only for some candidates (longer name or band text).Test the longest content and leave spare room. See Print & PDF Layout.
An empty last page.A page break after the last page, or min-height in print.Use .ti-page:not(:last-child) for breaks and unset min-height in print.
Fonts in the PDF differ from the screen.The font is not loaded inside the template.@import the font in the template's <style>.
Background colours are missing in print.Browsers drop backgrounds when printing.Add print-color-adjust: exact.
Images are missing in the PDF.Relative or private image URLs.Use public absolute https:// URLs.