Appearance
Opening a report in the viewer
The viewer (web/apps/viewer, served at /view/) is where readers open a report in the browser. There they expand and collapse groups, sort and filter, follow drill-through links, change parameters, and download it as PDF, Word or Excel. The studio can open any template there, so you can see it as readers will.
From the designer
- The Export dialog (Export in the designer's top strip, or in the Output panel). Below the formats, The draft opens the draft as it is now, and Published in environment opens what readers see in the environment the designer is on.
- The command palette (Ctrl+K, or Ctrl+Shift+P): Open the draft in the viewer and Open the published version in the viewer. Both are also in the top strip's More menu, under Document.
Either way, the viewer opens in a new tab. Unsaved edits are saved first, so the draft in the viewer is the one on the canvas.
From the catalog
Each template's row has a View menu: The draft, in the environment the catalog shows, and Published in each environment.
Who can, and when it doesn't open
- Permissions: viewing a report needs
report.viewin the environment. Viewing a draft also needstemplate.writethere, as editing it does. A menu entry or button you can't use says why. - The viewer is off: reportd serves the viewer only with
viewer.enabled. When it is off, the new tab closes again and the studio says so. An administrator turns it on in Admin, under Settings. - Not published: a template that isn't published in an environment has no published version there to open.
- Pop-ups blocked: the studio opens the tab straight away, as part of your click. If the browser still blocks it, allow pop-ups for the studio's address.
In the viewer
The report fills the window; the controls float over it, in the studio's theme (light, dark or the system's, and the brand's palette on a branded install). The report stays white paper in a dark theme.
- The bar at the top: Back and a breadcrumb of the reports a drill-through came from, the report's title, search, Continuous or Pages, Parameters, Download (PDF, Word or Excel, of the view as it is), the appearance, and the shortcut sheet.
- The pill at the bottom right: the page you are on, with the previous and next page (Pages only), and zoom. Fit fits the pages to the window's width.
- Parameters float at the right (a sheet from the bottom on a phone). They are open on a wide window to start with.
| Keys | What |
|---|---|
/ or Ctrl+F | Search the report; Enter and Shift+Enter, or Ctrl+G and Ctrl+Shift+G, step through the matches |
L | Continuous or pages |
P | Show or hide the parameters |
D | Download |
Ctrl+= and Ctrl+- , Ctrl+0, F | Zoom in and out, actual size, fit the width |
J, K | Next and previous page |
| Ctrl+Shift+L | Light, dark or system |
? or Ctrl+/ | The shortcut sheet |
Single letters work when no field has focus. On a Mac, Ctrl is ⌘. The code is in web/apps/viewer (the chrome) and web/packages/viewer (the report and its actions, which the designer's Interactive preview uses too).
How it works
The studio asks reportd for a view session (POST /v1/view/sessions, with draft: true for the draft), with the data reportd chooses (auto). A draft shows its samples. A published version shows live data when you may see live data (data.live), and its samples otherwise. Then it opens the viewerUrl from the answer. The session belongs to you, and lasts until it has gone unused for viewer.sessionTTLSec (30 minutes by default) or you sign out.
The code is in web/apps/designer/src/viewer.ts. The commands are document.viewDraft and document.viewPublished, in commands/view.ts.