pub struct ReportModel {
pub name: Option<String>,
pub dataset: DatasetReference,
pub filters: Vec<Filter>,
pub pages: Vec<Page>,
pub mobile_pages: Vec<Page>,
pub bookmarks: Vec<Bookmark>,
pub measures: Vec<ReportMeasure>,
}Expand description
Normalized report definition, regardless of source format (PBIR, PBIR-Legacy
Layout). One instance per report: an analysis runs one
TabularDatabase against the reports that share it,
and each report’s name completes its bindings’ provenance.
Fields§
§name: Option<String>Report identity for provenance: the .platform display name, or the report
folder’s name when the source records none.
dataset: DatasetReferenceThe semantic model this report connects to (PBIR datasetReference).
filters: Vec<Filter>Report-level filters (PBIR report.json filterConfig).
pages: Vec<Page>Pages in source order.
mobile_pages: Vec<Page>Pages of the phone layout (PBIR definition.mobile/), in source order.
The phone layout mirrors the desktop tree and binds the same model: a
field referenced only there still renders — on phones — so its bindings
are reachability roots like any other (issue #49). Report-level state
(report.json, report measures, bookmarks) is desktop-only and is not
read from the mobile tree.
bookmarks: Vec<Bookmark>Bookmarks in source order.
measures: Vec<ReportMeasure>Report-level measures (PBIR reportExtensions.json): DAX that lives in the
report, not the model.
Implementations§
Source§impl ReportModel
impl ReportModel
Sourcepub fn bindings(&self) -> Vec<BindingRef<'_>>
pub fn bindings(&self) -> Vec<BindingRef<'_>>
Every model-object reference the report makes, with its provenance — the reachability roots the graph’s BFS starts from.
Order follows report order (report filters, then per page: drillthrough
parameters, page filters, and each visual’s wells, filters, sorts, and
conditional formatting; then per bookmark: report-level filters, and per
section: section filters and each visual’s wells and filters), so the
result is deterministic for a given report and diffable across runs.
Mobile-layout pages (ReportModel::mobile_pages) enumerate after the
desktop pages, same shape, tagged BindingRef::mobile.
Everything borrows from the report, so this allocates only the returned
Vec.
§Examples
use ripbi_core::report::{BindingKind, FieldTarget, Filter, ReportModel};
use ripbi_core::NameKey;
let report = ReportModel {
filters: vec![Filter {
target: Some(FieldTarget::Column {
table: NameKey::new("Product"),
column: NameKey::new("Category"),
}),
..Default::default()
}],
..Default::default()
};
let bindings = report.bindings();
assert_eq!(bindings.len(), 1);
assert_eq!(bindings[0].kind, BindingKind::Filter);
// A report-level filter belongs to no page and no visual.
assert_eq!(bindings[0].page, None);
assert_eq!(bindings[0].visual, None);Sourcepub fn dax_expressions(&self) -> Vec<DaxExpressionRef<'_>>
pub fn dax_expressions(&self) -> Vec<DaxExpressionRef<'_>>
Every DAX expression defined report-side — report-level measures — on top of
TabularDatabase::dax_expressions,
which covers the model side.
A report measure has no home table, so home_table is always None:
unqualified [Name] references in its body can only be measures — of the
report first, then the model.
Owners borrow their names, so this allocates only the returned Vec.
Trait Implementations§
Source§impl Clone for ReportModel
impl Clone for ReportModel
Source§fn clone(&self) -> ReportModel
fn clone(&self) -> ReportModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReportModel
impl Debug for ReportModel
Source§impl Default for ReportModel
impl Default for ReportModel
Source§fn default() -> ReportModel
fn default() -> ReportModel
impl Eq for ReportModel
Source§impl PartialEq for ReportModel
impl PartialEq for ReportModel
impl StructuralPartialEq for ReportModel
Auto Trait Implementations§
impl Freeze for ReportModel
impl RefUnwindSafe for ReportModel
impl Send for ReportModel
impl Sync for ReportModel
impl Unpin for ReportModel
impl UnsafeUnpin for ReportModel
impl UnwindSafe for ReportModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.