Skip to main content

Crate ravenrs_grid_export

Crate ravenrs_grid_export 

Source
Expand description

Turns what a DataGrid shows into a file. The rows go through the report engine and its exporters, so a grid exports like a report does.

use ravenrs_grid_export::export;
use ravenrs_widgets::grid::{GridQuery, to_table};
use ravenrs_widgets::{GridColumn, GridExportFormat};

let columns = [GridColumn::text("Name"), GridColumn::number("Total")];
let rows = vec![vec!["Ana".into(), 12.5.into()]];
let table = to_table("Sales", "en-US", &columns, &rows, &GridQuery::default(), &[0]);
let file = export(&table, GridExportFormat::Xlsx, Some("2026-11-02"))?;
assert_eq!(file.name, "Sales 2026-11-02.xlsx");

Functions§

document_of
table laid out as a document, the same one the files are made from.
export
Writes table in format. suffix, such as a date, goes after the title in the name.