Slide 10
Slide 10 text
require 'thinreports'
# ...
ThinReports::Report.create layout: 'order.tlf' do |report|
report.start_new_page do |page|
page.item(:company_name).value(@customer.name)
page.item(:ordered_at).value(Time.now)
page.list(:list) do |list|
list.config.events.on :footer_insert do |e|
e.section.item(:total).value(@orders.total)
end
@orders.each do |order|
list.add_row do |row|
row.values(name: order.name, num: order.num,
price: order.price,
order_total: order.total)
end
end
end
end
end.generate_file('order.pdf')
HFNbUIJOSFQPSUT`
5IJO3FQPSUTHFOFSBUPS
129݄16༵