Skip to main content

ReportModel

Struct ReportModel 

Source
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: DatasetReference

The 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

Source

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);
Source

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

Source§

fn clone(&self) -> ReportModel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReportModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ReportModel

Source§

fn default() -> ReportModel

Returns the “default value” for a type. Read more
Source§

impl Eq for ReportModel

Source§

impl PartialEq for ReportModel

Source§

fn eq(&self, other: &ReportModel) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ReportModel

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.