Skip to content

Instantly share code, notes, and snippets.

@hidakatsuya
Last active September 26, 2015 19:58
Show Gist options
  • Save hidakatsuya/1150974 to your computer and use it in GitHub Desktop.
Save hidakatsuya/1150974 to your computer and use it in GitHub Desktop.
ThinReports Example: Basic List
# coding: utf-8
require 'rubygems'
require 'thinreports'
report = ThinReports::Report.new :layout => 'basic_list.tlf'
30.times do |t|
# Internaly #start_new_page() method is called,
# the page break automatically.
#
# [NOTE] In thinreports < 0.7.5:
# report.page.list(:default).add_row do |row|
# :
report.list.add_row do |row|
row.item(:detail).value("row##{t}")
end
end
# [NOTE] In thinreports < 0.7.7:
# report.generate_file 'basic_list.pdf'
report.generate :filename => 'basic_list.pdf'
@hidakatsuya
Copy link
Author

Thank you pointed out. I have made ​​corrections to the basic_list.tlf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment