pub struct Report {Show 18 fields
pub name: String,
pub page: PageSettings,
pub culture: String,
pub data_sources: Vec<DataSource>,
pub data_source: Option<String>,
pub data_member: Option<String>,
pub filter: Option<String>,
pub sort: Vec<SortField>,
pub parameters: Vec<Parameter>,
pub calculated_fields: Vec<CalculatedField>,
pub styles: BTreeMap<String, Style>,
pub report_header: Option<Band>,
pub page_header: Option<Band>,
pub groups: Vec<Group>,
pub detail: Band,
pub detail_reports: Vec<DetailReport>,
pub report_footer: Option<Band>,
pub page_footer: Option<Band>,
}Expand description
A banded report definition.
use ravenrs_report::{Band, Control, Report};
let report = Report::new("Customers")
.page_header(Band::new(24.0).control(Control::label("Name").at(0.0, 0.0, 200.0, 20.0)))
.detail(Band::new(20.0).control(Control::field("[Name]").at(0.0, 0.0, 200.0, 20.0)));
let json = report.to_json();
assert_eq!(ravenrs_report::Report::from_json(&json).expect("round trip"), report);Fields§
§name: StringThe report’s name, also the document title.
page: PageSettingsPaper size and margins.
culture: StringCulture for numbers and dates, such as pt-BR or en-US.
data_sources: Vec<DataSource>Where the data comes from, saved with the layout. The engine renders whatever data it is given; designers and the report server load it from here.
data_source: Option<String>The data source that feeds the report (the first one when unset).
data_member: Option<String>Path to the rows in the data (orders, report.lines). Without it, an
array of data is the rows and an object is a single row.
filter: Option<String>Rows for which this expression is false are left out.
sort: Vec<SortField>Sorting of detail rows within their groups.
parameters: Vec<Parameter>Values the user supplies when running the report (?Name in expressions).
calculated_fields: Vec<CalculatedField>Fields computed from other fields, usable like data fields.
styles: BTreeMap<String, Style>Named styles that controls refer to.
report_header: Option<Band>Printed once, at the top of the first page.
page_header: Option<Band>Printed at the top of every page.
groups: Vec<Group>Groups, outermost first.
detail: BandPrinted once per row.
detail_reports: Vec<DetailReport>Nested reports printed after each row’s detail (master-detail).
Printed once, after the last row.
Printed at the bottom of every page.
Implementations§
Source§impl Report
impl Report
Sourcepub fn page(self, page: PageSettings) -> Self
pub fn page(self, page: PageSettings) -> Self
Sets the paper.
Sourcepub fn data_source(self, source: DataSource) -> Self
pub fn data_source(self, source: DataSource) -> Self
Adds a data source and makes it the report’s source.
Sourcepub fn embedded_data(&self) -> Option<&Value>
pub fn embedded_data(&self) -> Option<&Value>
The data of the report’s source when it is stored in the layout.
Sourcepub fn data_member(self, path: &str) -> Self
pub fn data_member(self, path: &str) -> Self
Sets the path to the rows in the data.
Sourcepub fn parameter(self, name: &str, kind: ParameterKind, default: Value) -> Self
pub fn parameter(self, name: &str, kind: ParameterKind, default: Value) -> Self
Adds a parameter with a default value.
Sourcepub fn parameter_label(self, label: &str) -> Self
pub fn parameter_label(self, label: &str) -> Self
Sets what the user is asked for the parameter added last.
Sourcepub fn calculated(self, name: &str, expression: &str) -> Self
pub fn calculated(self, name: &str, expression: &str) -> Self
Adds a calculated field.
Sourcepub fn report_header(self, band: Band) -> Self
pub fn report_header(self, band: Band) -> Self
Sets the report header.
Sourcepub fn page_header(self, band: Band) -> Self
pub fn page_header(self, band: Band) -> Self
Sets the page header.
Sourcepub fn detail_report(self, detail: DetailReport) -> Self
pub fn detail_report(self, detail: DetailReport) -> Self
Adds a master-detail report.
Sets the report footer.
Sets the page footer.