Skip to main content

ExcelRenderer

Struct ExcelRenderer 

Source
pub struct ExcelRenderer {
Show 14 fields pub currency: String, pub schedule_weeks: u32, pub hours_per_day: f64, pub hours_per_week: f64, pub include_summary: bool, pub use_formulas: bool, pub project_start: Option<NaiveDate>, pub default_rate: f64, pub show_dependencies: bool, pub include_calendar_analysis: bool, pub include_diagnostics: bool, pub granularity: ScheduleGranularity, pub schedule_days: u32, pub auto_fit: bool, /* private fields */
}
Expand description

Excel costing report renderer

Fields§

§currency: String

Currency symbol

§schedule_weeks: u32

Number of weeks to show in schedule

§hours_per_day: f64

Working hours per day

§hours_per_week: f64

Working hours per week (for duration calculations)

§include_summary: bool

Whether to include Executive Summary sheet

§use_formulas: bool

Whether to include formulas (vs static values)

§project_start: Option<NaiveDate>

Project start date for schedule calculations

§default_rate: f64

Default rate for resources without explicit rate

§show_dependencies: bool

Whether to show dependency columns and use formula-driven scheduling

§include_calendar_analysis: bool

Whether to include Calendar Analysis sheet

§include_diagnostics: bool

Whether to include Diagnostics sheet

§granularity: ScheduleGranularity

Schedule time granularity (daily or weekly)

§schedule_days: u32

Number of days to show in daily schedule (default: 60)

§auto_fit: bool

Auto-fit timeframe to project duration (default: true)

Implementations§

Source§

impl ExcelRenderer

Source

pub fn new() -> Self

Source

pub fn currency(self, currency: impl Into<String>) -> Self

Set currency symbol

Source

pub fn weeks(self, weeks: u32) -> Self

Set number of weeks in schedule

Source

pub fn hours_per_day(self, hours: f64) -> Self

Set working hours per day

Source

pub fn no_summary(self) -> Self

Disable Executive Summary sheet

Source

pub fn static_values(self) -> Self

Use static values instead of formulas

Source

pub fn default_rate(self, rate: f64) -> Self

Set default rate for resources

Source

pub fn no_dependencies(self) -> Self

Disable dependency columns (simpler output, no formula-driven scheduling)

Source

pub fn hours_per_week(self, hours: f64) -> Self

Set working hours per week (default 40)

Source

pub fn with_calendar_analysis(self) -> Self

Include Calendar Analysis sheet showing weekend/holiday impact per task

Source

pub fn with_diagnostics(self, diagnostics: Vec<Diagnostic>) -> Self

Include Diagnostics sheet with all project diagnostics

Source

pub fn daily(self) -> Self

Use daily granularity (one column per calendar day)

Daily mode shows weekends and holidays with distinct styling, making it ideal for short-term operational planning (1-3 months).

Source

pub fn days(self, days: u32) -> Self

Set number of days to show in daily schedule (default: 60)

Only used when daily() is enabled.

Source

pub fn with_calendar(self, calendar: Calendar) -> Self

Set calendar for working days and holidays

Used in daily mode to determine weekend/holiday styling. If not set, defaults to Mon-Fri working days with no holidays.

Source

pub fn no_auto_fit(self) -> Self

Disable auto-fit and use explicit weeks/days values

By default, the renderer auto-fits the timeframe to cover the project duration plus a buffer. Call this to use the fixed schedule_weeks or schedule_days values instead.

Source

pub fn calculate_auto_fit_weeks( &self, schedule: &Schedule, project_start: NaiveDate, ) -> u32

Calculate auto-fit weeks to cover project duration

Returns the number of weeks needed to cover the full project plus a 10% buffer (minimum 1 week).

Uses the actual max task finish date (not schedule.project_end) to ensure all tasks are covered, even if there’s a discrepancy.

Source

pub fn calculate_auto_fit_days( &self, schedule: &Schedule, project_start: NaiveDate, ) -> u32

Calculate auto-fit days to cover project duration

Returns the number of days needed to cover the full project plus a 10% buffer (minimum 5 days).

Uses the actual max task finish date (not schedule.project_end) to ensure all tasks are covered, even if there’s a discrepancy.

Source

pub fn get_effective_weeks( &self, schedule: &Schedule, project_start: NaiveDate, ) -> u32

Get effective weeks (auto-fit or manual)

Source

pub fn get_effective_days( &self, schedule: &Schedule, project_start: NaiveDate, ) -> u32

Get effective days (auto-fit or manual)

Source

pub fn render_to_bytes( &self, project: &Project, schedule: &Schedule, ) -> Result<Vec<u8>, RenderError>

Generate Excel workbook bytes

Trait Implementations§

Source§

impl Clone for ExcelRenderer

Source§

fn clone(&self) -> ExcelRenderer

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 ExcelRenderer

Source§

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

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

impl Default for ExcelRenderer

Source§

fn default() -> Self

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

impl Renderer for ExcelRenderer

Renderer implementation that saves to file path

Source§

type Output = Vec<u8>

Source§

fn render( &self, project: &Project, schedule: &Schedule, ) -> Result<Vec<u8>, RenderError>

Render a schedule to the output format

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<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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.