仕事でRailsアプリに帳票出力(納品書とか請求書とか)機能を追加したのでメモ。 インストール Gemfile gem 'thinreports'※この他に別途、ThinReports Editor(帳票レイアウトエディタ)が必要。 基本的な使い方(Rails関係無く) 先にThinReports Editorで帳票レイアウトを作成しておく。 styleはエディタでも指定しておける。 # coding: utf-8 require 'thinreports' report = ThinReports::Report.new # 帳票レイアウトの指定 report.use_layout 'hoge.tlf' # ページの作成 report.start_new_page # idがdateのテキストブロックに今日の日付を書き込む report.page.item(:date).value(Ti