Skip to main content

Crate ravenrs_report_viewer

Crate ravenrs_report_viewer 

Source
Expand description

Document viewer for RavenRS Reporting.

  • DocumentViewer shows a rendered Document: pages, zoom, thumbnails and text search that finds words regardless of case and accents.
  • ParameterPanel asks for a report’s parameters and applies them together.
  • ViewerState holds what the user has chosen, so it survives rebuilds and can be shared with the rest of an app.
use std::rc::Rc;
use ravenrs_report::{Band, Control, Report, ReportEngine};
use ravenrs_report_viewer::{DocumentViewer, ViewerState};
use serde_json::json;

let report = Report::new("Sales").detail(Band::new(18.0).control(Control::field("[Name]").at(0.0, 0.0, 200.0, 18.0)));
let document = Rc::new(ReportEngine::new().render(&report, &json!([{ "Name": "Ana" }])));
let state = ViewerState::new();
let viewer = DocumentViewer::new(document, &state);

Structs§

DocumentViewer
Shows a rendered document.
Match
Where a search result is.
PageFan
Pages of rendered reports spread like a hand of cards. They open as the fan scrolls into view; the page under the pointer (or keyboard focus) comes to the front and lifts with an accent ring while the others step back, and a click opens its address through ravenrs_widgets::Links. Each page is painted once at its size and reused, so scrolling and hovering repaint nothing but positions.
ParameterLabels
The text a parameter panel shows.
ParameterPanel
Asks for values of parameters, with a control for each one’s kind.
ViewerLabels
The text a viewer shows.
ViewerState
What a viewer remembers. Clones share the same state.

Functions§

find_matches
Every match of query, in reading order of the document’s blocks.
print
Prints the document: through a hidden frame and the browser’s print dialog on the web, or by opening the page in the default browser, with its print dialog up, on the desktop.

Type Aliases§

ParameterValues
Parameter values by name, as ravenrs_report::RenderOptions takes them.