pub struct ReportTemplate {
pub fonts: TemplateFonts,
pub border_color: String,
pub header_fill: String,
pub col_widths: [f64; 5],
pub data_row_height: f64,
pub title_row_height: f64,
pub show_hours_column: bool,
pub show_result_column: bool,
pub show_comment: bool,
pub comment_rows: u32,
}Expand description
A complete, serializable description of the hourly report’s visual design.
All measurements mirror the values previously hardcoded for the SiServer
layout so that ReportTemplate::siserver reproduces the original look
byte-for-byte.
Fields§
§fonts: TemplateFontsFonts for the various report elements.
border_color: StringCell border color as #RRGGBB.
header_fill: StringHeader/total fill color as #RRGGBB.
col_widths: [f64; 5]Widths of the five data columns (B..F).
data_row_height: f64Height of each hourly data row.
title_row_height: f64Height of the title row.
show_hours_column: boolWhether to render the “hours” column.
show_result_column: boolWhether to render the “result” column.
show_comment: boolWhether to render the comment label and comment box.
comment_rows: u32Number of rows the comment box spans.
Implementations§
Source§impl ReportTemplate
impl ReportTemplate
Sourcepub fn siserver() -> Self
pub fn siserver() -> Self
Returns the built-in siserver template reproducing the original design.
Sourcepub fn load(name: &str) -> Self
pub fn load(name: &str) -> Self
Loads the named template, falling back to the built-in Self::siserver.
The lookup path is <data>/report_templates/<name>.json. Missing files
or parse errors are non-fatal: the built-in default is returned instead.
Regardless of the requested name, the default siserver.json is
materialized on disk (if absent) as an editable example.
Sourcepub fn ensure_default_on_disk() -> Result<()>
pub fn ensure_default_on_disk() -> Result<()>
Writes the built-in siserver.json template to disk when it is missing.
This gives users a ready-to-copy reference for authoring custom templates. Existing files are never overwritten.
Trait Implementations§
Source§impl Clone for ReportTemplate
impl Clone for ReportTemplate
Source§fn clone(&self) -> ReportTemplate
fn clone(&self) -> ReportTemplate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more