Expand description
§reports-web
Reports.Web for Rust: build print data (PREPEJ) from report definitions (.prepdj) designed in the browser,
and render PDF with the Reports.Web engine (C++ WebAssembly, Docker image ghcr.io/reportsweb/engine).
帳票定義(.prepdj)に値を入れて印刷データ(PREPEJ)を作り、Reports.Web エンジンで PDF にします。
use reports_web::{PrintData, ReportsWebEngine};
let definition: serde_json::Value = serde_json::from_str(&std::fs::read_to_string("report.prepdj")?)?;
let mut print_data = PrintData::new();
print_data.set_definition(&definition)?.page_start()?;
print_data.set_value("Title", "あっという間に帳票出力")?.page_end()?;
let pdf = ReportsWebEngine::new("http://127.0.0.1:3107")?.render_pdf(&print_data).await?;
std::fs::write("report.pdf", pdf)?;Trial build: output carries a red “SAMPLE” mark until the purchased license file is configured in the engine. https://www.pao.ac/reports.web/
Structs§
- Engine
Error - Error from the Reports.Web engine.
statusis the HTTP status, orNonefor transport errors. - Print
Data - Framework-independent builder for the shared PREPEJ print-document format. One instance belongs to one report/request; input definitions and output are cloned.
- Reports
WebEngine - Async client for the Reports.Web engine.