Skip to content

Add reports and custom HTML to a dashboard

How-to8 minPractitioner

Before you start

A dashboard can hold more than numbers. A Report block shows a report you already saved, and a Custom HTML block shows a panel you design yourself. Both sit in a section like a metric does.

  1. Open the dashboard in the Page builder.
  2. Drag Report into a section, or click Add block and choose Report. The block says Choose a report.
  3. In the right panel, click a report under Report. Use Search reports to find it.
  4. Change the Title if you want a different heading above the report.
  5. Click Save.

The canvas draws a placeholder with the report’s name and “Drawn with live data on the dashboard”. The real chart or table shows to people in App space. A new block takes its title from the report. Label keys work in the Title, so the heading can follow each person’s language.

Save a report before adding it to a block. Choose an existing report from the list.

On the Style tab, Transparent background blends the report into the section instead of putting it on a card.

Use a Custom HTML block for custom content: a status banner, a checklist, a row of links.

  1. Drag Custom HTML into a section. The code drawer opens on the HTML tab.
  2. Write your markup. Put each changing value in ${name} form, for example ${overdue}.
  3. Open the Variables tab. Each variable you wrote is listed there with an empty script box.
  4. Write a Smart Script for each variable. The script’s result replaces the variable.
  5. Check the Preview pane beside the code.
  6. Close the drawer and click Save.

For example, this panel tells people how many invoices are overdue. The HTML tab holds:

<div class="overdue-note">
<strong>${overdue}</strong> invoices are overdue.
</div>

The CSS tab holds:

.overdue-note { padding: 14px; font-size: 15px; }

And the script for the overdue variable, on the Variables tab, is:

var n = parseInt(FunctionManager.evaluateCount("cm_invoices", "WHERE cm_invoices.status = 'Overdue'"), 10);
isNaN(n) ? 0 : n;

The same script rules apply as for a metric: no return, convert text with parseInt or parseFloat, and guard lists that can be null. Show a number with a metric block has the detail.

TabWhat it holds
HTMLYour markup, with ${variables}
CSSStyles for the block
Style linksLinks to stylesheets. They load on the live dashboard
VariablesOne script per variable, with a count on the tab

The note at the top of the drawer says “Changes apply as you type.”

On the Content tab, the Name is only for you, in Layers. Edit code reopens the drawer. The Style tab has Transparent background, which is on by default for a Custom HTML block. Turn it off for a Background colour or a Gradient.

A dashboard with a chart or table from your reports and a panel of your own, each in a section. Use and switch dashboards shows what people see.

Check yourself

Karim wants a Report block on the dashboard. What must exist first?
Show the answer

A saved report to pick. The Report block lists the reports you already saved. Create the report first, then come back and pick it.

In a Custom HTML block you write `${overdue}`. Where does the value come from?
Show the answer

A Smart Script you write for the overdue variable, under Variables. Each variable found in the HTML gets its own script on the Variables tab. The script's result replaces the variable.

What's next

Last checked