Generates ODF files, given a template (.odt) and data, replacing tags
Generates ODF files, given a template (.odt) and data, replacing tags
Generate .odt documents by filling templates with dynamic content — fields, tables, sections, and images.
For more detailed guides, examples, and API reference, check out the new Documentation Site.
In your Gemfile
gem 'odf-report'Create a .odt template in LibreOffice with [PLACEHOLDERS], then use the Ruby DSL to fill them in:
report = ODFReport::Report.new("template.odt") do |r|
r.add_field :company_name, "Acme Corp"
r.add_field :date, Date.today.to_s
r.add_table("EMPLOYEES", @employees, header: true) do |t|
t.add_column(:name)
t.add_column(:email)
t.add_column(:department, :dept_name)
end
r.add_image :logo, "/path/to/logo.png"
end
report.generate("output.odt")There are five kinds of substitutions available:
[PLACEHOLDER] text with valuesNo open issues yet, or sync has not completed.