Embedded outputs and report-style notebooks

功能性的

Show a cell as its output alone so a notebook reads like a report, keep pivot and chart settings beside it or hidden, and lock a result grid to rows, pivot or chart.

A notebook's dashboard: the editor with its tiles, a cell added as a tile, the viewer with a typed Country filter, then a report-style notebook whose cells show only their output.

Real recording · typing sped up · Northwind demo data

Open the walkthrough on its own page

Any cell can be shown as its output alone: a query shows only its result grid, a pivot only the pivot table, a chart only the chart, with no header, editor, result tabs or settings. Embedded outputs sit flush with the cells around them, so a notebook of Markdown and embedded results reads like a report instead of a workbench. The SQL is still there; one click brings a cell back in full.

SQLly
Notebook reading like a report, with an embedded grid, pivot and chart between Markdown paragraphsNotebook reading like a report, with an embedded grid, pivot and chart between Markdown paragraphs
A report-style notebook with every output embedded: Markdown, a summary grid, a pivot without its sidebar and a bar chart, with no cell chrome between them.

Embedding a cell or the whole notebook

  • One cell, or the selection: choose Embed output in the cell menu, or press E in command mode. E again (or Show in full) brings the cells back.
  • The whole notebook: More ▸ Embed All Outputs in the top bar, or the palette's Notebook: Embed All Outputs. This becomes the notebook's default, so cells you add later are embedded too. A cell you set by hand to the other mode keeps its own setting.

Parameter cells and dashboards always stay in full, because their inputs and layout are the point. Every change to how a cell is shown is one undo step, and it is saved in the notebook file (in .ipynb files too), so whoever opens the notebook sees the same report. It never counts as an edit to a trusted notebook, and embedding never runs anything.

What each kind of cell shows

CellEmbedded, it shows
SQLThe result grid only, the live grid with its formats and directives, sized to its rows (80 to 420 pixels) unless you resize it. Before the cell has run: "Not run yet" with a 執行 button. A failed run shows its error line; a statement that returns no rows shows its message or "No rows returned".
資料表The grid only.
樞紐分析The pivot table, sized to its rows, with its field list beside it only if you show the configuration.
圖表The chart, live or drawn, with the chart editor beside it only if you show the configuration. Click-to-filter still works; see Click to filter.
MarkdownThe rendered text, with formula values and parameters filled in.
KPI, formula, profile, tests, diff, query plan, entity detail, attachment, AITheir output without the settings above it: the tiles, the value, the column cards, the outcomes, the comparison, the plan, the record, the file preview or picture, the findings.

An embedded output keeps a small state mark in its bottom-right corner when its result isn't simply up to date: out of date, partial, failed, blocked, running, queued or canceled. Charts, KPIs and other visual cells keep their own completeness notices too, so an embedded chart over a cut-short result still says so.

Pivot and chart settings beside the output

An embedded pivot or chart hides its configuration by default. Show configuration (in the cell menu, the floating control, or the palette's Notebook: Show or Hide Embedded Configuration) puts the pivot's field list or the chart's options beside the output, so a report can keep them at hand. Changing the pivot there and saving its layout writes it to the cell, the same as in full mode. Whether the configuration is shown is saved with the cell.

SQLly
Embedded pivot table with its field list beside itEmbedded pivot table with its field list beside it
An embedded pivot with its configuration shown: the field list sits beside the pivot table.

Double-clicking a value in an embedded pivot shows the rows behind it in a grid, with Back to pivot to return.

Getting back to the SQL

Hover over an embedded output, or select its cell, and a small control appears at its top right: Show in full, Show configuration 或 Hide configuration (pivots and charts), 執行 and the cell menu. Run goes through the same checks as the cell header's Run button, so read-only, trust and production rules all apply. Drag the bottom edge of a SQL, table, pivot or chart output to change its height; the height is kept in the cell.

SQLly
Floating control over an embedded result gridFloating control over an embedded result grid
Hovering an embedded grid shows its control: Show in full, Run and the cell menu.

Lock view

A SQL or table cell's result grid can switch between its rows, a pivot and a chart. Lock view in the cell menu fixes it on one of them: Lock to rows, Lock to pivot 或 Lock to chart,或 View can switch to undo it. It works in full mode as well as embedded, so readers of a shared notebook see the view the author chose and can't switch away from it. A locked grid in full mode keeps its tab bar, showing which view it is on.

Because a locked pivot or chart can't jump to the rows view, double-clicking a pivot value or clicking a chart bar lists the rows behind it in a small grid under the output, titled with what you clicked and how many rows match, with 關閉.

Dashboards, presentation and exports

  • Dashboard tiles, the dashboard viewer and presentation draw a cell's output the same way an embedded cell does, but never show its configuration. See Dashboards and presentation.
  • Zen and Dense work with embedded outputs: Zen hides the panels, Dense tightens the spacing.
  • Exports ignore how a cell is shown. An embedded SQL cell's SQL is included or left out according to the export's own SQL setting, not because it was hidden on screen. See Exporting.
  • 瀏覽器版本 embeds outputs the same way.

限制

  • A SQL cell with several statements embeds or locks only the result set that is active in its grid.
  • When a result too large for memory has been written to disk, a drill in a locked or embedded grid filters the grid to the rows behind it instead of listing them underneath, and that filtered view can't be seen until you unlock the cell or show it in full.
  • Showing an embedded cell in full again opens its grid's pivot and chart panels, even if you had collapsed them before embedding it.