Created
August 17, 2011 06:39
-
-
Save hidakatsuya/1150942 to your computer and use it in GitHub Desktop.
ThinReports Example: Multiple Layouts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
require 'rubygems' | |
require 'thinreports' | |
report = ThinReports::Report.create do | |
use_layout 'multiple_default', :default => true | |
use_layout 'multiple_cover', :id => :cover | |
# Add :cover layout (using multiple_cover.tlf). | |
start_new_page :layout => :cover | |
# Add 5 page using :default layout (multiple_default.tlf). | |
5.times do |t| | |
start_new_page do |page| | |
page.item(:content).value(t + 1) | |
end | |
end | |
# Add "multiple_back_cover.tlf" layout. | |
start_new_page :layout => 'multiple_back_cover.tlf' | |
end | |
report.generate_file('multiple_layouts.pdf') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment