Sha256: ac84c59818aa0da663671d3564308bbb58e90ab3038086c8b3ca73a9cbce689f
Contents?: true
Size: 825 Bytes
Versions: 2
Compression:
Stored size: 825 Bytes
Contents
# coding: utf-8 example :list_events, 'Basic list events' do |t| Thinreports::Report.generate filename: t.output_filename do |report| report.use_layout t.layout_filename report.list.header title: 'Prices' report.list do |list| price_for = { page: 0, all: 0 } list.on_page_finalize do price_for[:all] += price_for[:page] price_for[:page] = 0 end list.on_page_footer_insert do |footer| footer.item(:price).value(price_for[:page]) end list.on_footer_insert do |footer| footer.item(:price).value(price_for[:all]) end [100, 200, 250, 50, 100, 20, 30, 50, 100, 100].each do |price| list.add_row price: price # Calculate sum price for each page of list price_for[:page] += price end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
thinreports-0.9.1 | examples/list_events/list_events.rb |
thinreports-0.9.0 | examples/list_events/list_events.rb |