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
function numberWithDelimiter(n) { | |
n = String(n); | |
while(n != (n = n.replace(/^(-?\d+)(\d{3})/, "$1,$2"))); | |
return n; | |
} |
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' | |
ThinReports::Report.generate_file('tblock.pdf', :layout => 'tblock.tlf') do | |
start_new_page | |
page.values :single_line_left => 'Left(Default)', | |
:single_line_center => 'Center', |
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). |
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' | |
ThinReports::Report.generate_file('events.pdf') do | |
use_layout 'events' | |
events.on :page_create do |e| | |
e.page.item(:event_page_create).value('Dispatched at before page creating.') |
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.new :layout => 'advanced_list' | |
report.layout.config.list(:advanced_list) do | |
# Define the variables used in list. | |
use_stores :row_count => 0, |
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.new :layout => 'basic_list.tlf' | |
30.times do |t| | |
# Internaly #start_new_page() method is called, | |
# the page break automatically. |
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.new :layout => 'book_detail.tlf' | |
report.start_new_page do |page| | |
page.item(:title).value('はじめての「ThinReports」') | |
page.item(:author).value('帳票 太郎') |
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' | |
# Prepare sample data. | |
data = [] | |
# Sample Data 1 | |
d1 = {:no => 1234, |
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' | |
require 'open-uri' | |
def open_chart(*params) | |
open('http://chart.googleapis.com/chart?' + URI.encode(params.join('&'))) | |
end |
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' | |
# Load libraries of barby. | |
require 'barby' | |
require 'barby/barcode/ean_13' | |
require 'barby/barcode/ean_8' | |
require 'barby/barcode/qr_code' |
OlderNewer