Expand description
One way to turn a report [Document] into a file. The editor, the server and
any other module call this, so a report exports the same from anywhere.
use ravenrs_report::{Band, Control, Report, ReportEngine};
use ravenrs_report_export::{ExportFormat, export};
use serde_json::json;
let report = Report::new("Vendas").detail(Band::new(18.0).control(Control::field("[N]").at(0.0, 0.0, 200.0, 18.0)));
let document = ReportEngine::new().render(&report, &json!([{ "N": "Ana" }]));
let file = export(&document, ExportFormat::Pdf, Some("2026-11-01"))?;
assert_eq!(file.name, "Vendas 2026-11-01.pdf");
assert_eq!(file.mime, "application/pdf");Structs§
- Exported
File - A file ready to be saved or sent.
Enums§
- Export
Format - A format a document can be exported to.