AshReports.Band (ash_reports v0.1.0)

Represents a band within a report structure.

Bands are the fundamental building blocks of reports and can be hierarchically nested. They contain elements that define what data and formatting to display.

Summary

Functions

Gets all child bands recursively.

Checks if this is a detail band type.

Gets the element with the given name from the band.

Gets all elements of a specific type from the band.

Checks if this is a group band (group_header or group_footer).

Creates a new Band struct with the given name and options.

Types

band_type()

@type band_type() ::
  :title
  | :page_header
  | :column_header
  | :group_header
  | :detail_header
  | :detail
  | :detail_footer
  | :group_footer
  | :column_footer
  | :page_footer
  | :summary

t()

@type t() :: %AshReports.Band{
  bands: [t()] | nil,
  can_grow: boolean(),
  can_shrink: boolean(),
  columns: pos_integer() | String.t() | [String.t()] | nil,
  detail_number: pos_integer() | nil,
  elements: [AshReports.Element.t()],
  grids: [AshReports.Layout.Grid.t()] | nil,
  group_level: pos_integer() | nil,
  height: pos_integer() | nil,
  keep_together: boolean(),
  name: atom(),
  on_entry: Ash.Expr.t() | nil,
  on_exit: Ash.Expr.t() | nil,
  padding: keyword() | nil,
  repeat_on_pages: boolean() | nil,
  stacks: [AshReports.Layout.Stack.t()] | nil,
  tables: [AshReports.Layout.Table.t()] | nil,
  target_alias: Ash.Expr.t() | nil,
  type: band_type(),
  visible: Ash.Expr.t() | boolean()
}

Functions

all_bands(band)

@spec all_bands(t()) :: [t()]

Gets all child bands recursively.

detail_band?(band)

@spec detail_band?(t()) :: boolean()

Checks if this is a detail band type.

get_element(band, name)

@spec get_element(t(), atom()) :: AshReports.Element.t() | nil

Gets the element with the given name from the band.

get_elements_by_type(band, type)

@spec get_elements_by_type(t(), atom()) :: [AshReports.Element.t()]

Gets all elements of a specific type from the band.

group_band?(band)

@spec group_band?(t()) :: boolean()

Checks if this is a group band (group_header or group_footer).

new(name, opts \\ [])

@spec new(atom(), Keyword.t()) :: t()

Creates a new Band struct with the given name and options.