Skip to content

Instantly share code, notes, and snippets.

@hidakatsuya
Created September 4, 2012 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hidakatsuya/3622334 to your computer and use it in GitHub Desktop.
Save hidakatsuya/3622334 to your computer and use it in GitHub Desktop.
[ThinReports] 基本的なページ番号
report = ThinReports::Report.new :layout => 'page_no.tlf'
report.events.on :page_create do |e|
e.page.item(:page_no).value(e.page.no)
end
report.events.on :generate do |e|
page_count = e.report.page_count
e.pages.each do |page|
page.item(:page_count).value(page_count)
end
end
3.times { report.start_new_page }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment