Skip to content

DashboardEngine: add exportReport(dir) — export ALL pages of a multi-page dashboard, not just the active one #344

Description

@HanSur94

Problem / motivation

DashboardEngine.exportImage documents — in its own header — that it silently drops every page but the active one:

"Multi-page dashboards capture the active page only because non-active pages use Visible='off'." — libs/Dashboard/DashboardEngine.m:1017

Multi-page navigation is a headline feature of this Advanced Dashboard milestone (tabs, collapsible groups, multi-page navigation). So the workflow the milestone is built around — organizing a long recording into "Overview / Vibration / Temperatures / Events" pages — has no way to be exported in full. d.exportImage('out.png') gives the reviewer page 1 and drops the rest, with no warning. That is a data-loss-shaped surprise on the flagship feature.

There is no all-pages / report export today (grep -niE "exportReport |exportAllPages|exportPages" over DashboardEngine.m → none).

Proposed feature

A new public method that walks every page and writes one image per page:

files = d.exportReport('out/');                    % out/dashboard-p1-overview.png, out/dashboard-p2-vibration.png, ...
files = d.exportReport('out/', 'Format', 'jpeg');
files = d.exportReport('out/', 'BaseName', 'run42');

Returns the cellstr of written file paths.

Rough sketch

  • File: libs/Dashboard/DashboardEngine.m — new exportReport(obj, destDir, varargin) (~40–60 lines) + a small filename-slug helper for page names.
  • Logic:
    1. record the current ActivePage;
    2. loop pgIdx = 1:numel(obj.Pages), calling switchPage(pgIdx) + drawnow, then reusing the existing exportImage capture backend to write one file per page (<BaseName>-p<idx>-<pageslug>.<ext>);
    3. restore the original ActivePage via switchPage.
  • Reuses existing primitives: Pages (cell of DashboardPage), ActivePage, switchPage(idx) (DashboardEngine.m:48,175,240) and the per-platform capture path already in exportImage (exportapp / exportgraphics / Octave print) — so it inherits the same format support automatically.
  • Graceful degrade: single-page dashboards (ActivePage == 0 / numel(Pages) <= 1) write exactly one file — identical to exportImage today.
  • Test: one suite test asserting N files for an N-page dashboard and that ActivePage is restored afterward.

Value

High for the report/handoff/archival workflow: the reviewer gets a complete artifact instead of silently losing all pages but the active one — on the exact feature the milestone is built around.

Constraints check

  • Toolbox-free ✅ — reuses the existing exportImage capture path; no new dependency.
  • Backward-compatible ✅ — purely additive method; single-page/exportImage behaviour unchanged; serialized dashboards unaffected.
  • Pure MATLAB/Octave ✅ — a loop over switchPage + existing capture; works on R2020b+ and Octave.
  • Contracts ✅ — operates entirely through existing DashboardEngine / DashboardPage public surface.

Effort estimate

S–M — one method in DashboardEngine.m plus a slug helper and one suite test; leans on existing switchPage + exportImage internals.

Not this issue (distinct from #302)

#302 widens the format (vector PDF/SVG) of the single active page — it never iterates pages. This is orthogonal: iterate pages. The two compose — a 'Combined',true single multi-page-PDF mode is a sensible follow-up once both land (version-gated on exportgraphics 'Append' / Octave print -append), deliberately kept out of scope here to stay R2020b/Octave-safe.


AI-proposed via /feature-scout — needs a human product decision before implementation.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions