Expand description
Document viewer for RavenRS Reporting.
DocumentViewershows a renderedDocument: pages, zoom, thumbnails and text search that finds words regardless of case and accents.ParameterPanelasks for a report’s parameters and applies them together.ViewerStateholds 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§
- Document
Viewer - 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. - Parameter
Labels - The text a parameter panel shows.
- Parameter
Panel - Asks for values of parameters, with a control for each one’s kind.
- Viewer
Labels - The text a viewer shows.
- Viewer
State - What a viewer remembers. Clones share the same state.
Functions§
- find_
matches - Every match of
query, in reading order of the document’s blocks. - 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§
- Parameter
Values - Parameter values by name, as
ravenrs_report::RenderOptionstakes them.