Create!Formの出力体験や
1ヶ月間無料の試用はこちら
Create!Formは、Windows・Linux環境においてRubyから利用可能な帳票ツールです。
この記事では、RubyでPDF、HTML、Excel、印刷の帳票を出力する最も簡単なサンプルコードを紹介します。
運用要件に応じた出力形態を以下のタブメニューから選択してご覧ください。
まず、Create!Formを使ってHTML帳票を生成する手順を説明します。

3の、Create!Form Screenを呼び出すRubyサンプルコードを以下に記載します。
実行パラメーターに、作業ディレクトリ、スタイルファイル、出力ファイル名、入力データファイル名を設定し、Create!Form Screenを呼び出します。
require 'fiddle/import'
module CreateForm
extend Fiddle::Importer
dlload "C:/Program Files (x86)/Infotec/CreateForm/12/CScreen.dll"
extern "int CScreenS(char*)"
end
wkdir = "C:/ProgramData/Infotec/CreateForm/12/work/reference/barcode"
commandline = "-D#{wkdir} -scode39.sty -o#{wkdir}/code39.html #{wkdir}/code39.csv"
rcode = CreateForm.CScreenS commandline
if rcode != 1
puts "[Error] #{rcode}"
end
require 'fiddle/import'
module CreateForm
extend Fiddle::Importer
dlload "/usr/local/cf/screen/csys/libcscreen.so"
extern "int CScreen(char*)"
end
wkdir = "C:/ProgramData/Infotec/CreateForm/11/work/reference/barcode"
commandline = "-D#{wkdir} -scode39.sty -o#{wkdir}/code39.html #{wkdir}/code39.csv"
rcode = CreateForm.CScreen commandline
if rcode != 1
puts "[Error] #{rcode}"
end
このサンプルコードを実行すると、指定したディレクトリにHTML帳票「code39.html」が作成されます。