Skip to content

Instantly share code, notes, and snippets.

@hidakatsuya
Created August 17, 2011 06:56
Show Gist options
  • Save hidakatsuya/1150985 to your computer and use it in GitHub Desktop.
Save hidakatsuya/1150985 to your computer and use it in GitHub Desktop.
ThinReports Example: Book Detail Sample
# coding: utf-8
require 'rubygems'
require 'thinreports'
report = ThinReports::Report.new :layout => 'book_detail.tlf'
report.start_new_page do |page|
page.item(:title).value('はじめての「ThinReports」')
page.item(:author).value('帳票 太郎')
page.item(:released_at).value(Time.now)
page.item(:price).value(3400)
page.item(:has_stock).show
page.item(:description).value('Ruby向けOSS帳票ソリューション「ThinReports」の' +
'概念、セットアップ方法から基本的な使い方まで、はじめてThinReportsを' +
'使われる方、もしくはThinReportsを検討している方向けの内容になっています。')
end
report.start_new_page do
values(:title => 'ThinReports逆引き辞典',
:author => '帳票 太郎',
:released_at => Time.now,
:price => 1980,
:description => 'Ruby向けOSS帳票ソリューション「ThinReports」の' +
'使い方を目的別にまとめています。')
end
report.generate_file('book_detail.pdf')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment