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: StringCurrency symbol
schedule_weeks: u32Number of weeks to show in schedule
hours_per_day: f64Working hours per day
hours_per_week: f64Working hours per week (for duration calculations)
include_summary: boolWhether to include Executive Summary sheet
use_formulas: boolWhether to include formulas (vs static values)
project_start: Option<NaiveDate>Project start date for schedule calculations
default_rate: f64Default rate for resources without explicit rate
show_dependencies: boolWhether to show dependency columns and use formula-driven scheduling
include_calendar_analysis: boolWhether to include Calendar Analysis sheet
include_diagnostics: boolWhether to include Diagnostics sheet
granularity: ScheduleGranularitySchedule time granularity (daily or weekly)
schedule_days: u32Number of days to show in daily schedule (default: 60)
auto_fit: boolAuto-fit timeframe to project duration (default: true)
Implementations§
Source§impl ExcelRenderer
impl ExcelRenderer
pub fn new() -> Self
Sourcepub fn hours_per_day(self, hours: f64) -> Self
pub fn hours_per_day(self, hours: f64) -> Self
Set working hours per day
Sourcepub fn no_summary(self) -> Self
pub fn no_summary(self) -> Self
Disable Executive Summary sheet
Sourcepub fn static_values(self) -> Self
pub fn static_values(self) -> Self
Use static values instead of formulas
Sourcepub fn default_rate(self, rate: f64) -> Self
pub fn default_rate(self, rate: f64) -> Self
Set default rate for resources
Sourcepub fn no_dependencies(self) -> Self
pub fn no_dependencies(self) -> Self
Disable dependency columns (simpler output, no formula-driven scheduling)
Sourcepub fn hours_per_week(self, hours: f64) -> Self
pub fn hours_per_week(self, hours: f64) -> Self
Set working hours per week (default 40)
Sourcepub fn with_calendar_analysis(self) -> Self
pub fn with_calendar_analysis(self) -> Self
Include Calendar Analysis sheet showing weekend/holiday impact per task
Sourcepub fn with_diagnostics(self, diagnostics: Vec<Diagnostic>) -> Self
pub fn with_diagnostics(self, diagnostics: Vec<Diagnostic>) -> Self
Include Diagnostics sheet with all project diagnostics
Sourcepub fn daily(self) -> Self
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).
Sourcepub fn days(self, days: u32) -> Self
pub fn days(self, days: u32) -> Self
Set number of days to show in daily schedule (default: 60)
Only used when daily() is enabled.
Sourcepub fn with_calendar(self, calendar: Calendar) -> Self
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.
Sourcepub fn no_auto_fit(self) -> Self
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.
Sourcepub fn calculate_auto_fit_weeks(
&self,
schedule: &Schedule,
project_start: NaiveDate,
) -> u32
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.
Sourcepub fn calculate_auto_fit_days(
&self,
schedule: &Schedule,
project_start: NaiveDate,
) -> u32
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.
Sourcepub fn get_effective_weeks(
&self,
schedule: &Schedule,
project_start: NaiveDate,
) -> u32
pub fn get_effective_weeks( &self, schedule: &Schedule, project_start: NaiveDate, ) -> u32
Get effective weeks (auto-fit or manual)
Sourcepub fn get_effective_days(
&self,
schedule: &Schedule,
project_start: NaiveDate,
) -> u32
pub fn get_effective_days( &self, schedule: &Schedule, project_start: NaiveDate, ) -> u32
Get effective days (auto-fit or manual)
Sourcepub fn render_to_bytes(
&self,
project: &Project,
schedule: &Schedule,
) -> Result<Vec<u8>, RenderError>
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
impl Clone for ExcelRenderer
Source§fn clone(&self) -> ExcelRenderer
fn clone(&self) -> ExcelRenderer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more