No commit activity in last 3 years
No release in over 3 years
Generate pdf reports on Rails using Jasper Reports reporting tool.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0
~> 2.13

Runtime

>= 1.0.3
>= 3.0.7
 Project Readme

hashed-jasper-rails¶ ↑

Hashed-jasper-rails was inspired by jasper-rails.(github.com/fortesinformatica/jasper-rails) This can use hash as a data source.

How to use¶ ↑

(1) Add your Gemfile.

gem "hashed-jasper-rails"

(2) Add action method.

# app/controllers/users_controller.rb

def print
  users = [
      {:name => "Izumi Konata", :email => "konata@example.com"},
      {:name => "Hiiragi Tsukasa", :email => "tsukasa@example.com"},
      {:name => "Hiiragi Kagami", :email => "kagami@example.com"}
  ]
  jasper_pdf :resource => users
end

(3) Edit a jasper template file.

Template propaties.
Query Text: /jasper/record 
The language for the dataset query: xPath

for Japanese.
  Text Field propaties.
  Pdf Font: HeiseiMin-W3 or HeiseiKakuGo-W5
  Pdf Encoding: UniJIS-UCS2-H (Japanese)

(4) Set a jasper template file.

# app/views/users/print.jasper

Options.¶ ↑

(1) Set a model and record name.

jasper_pdf :resource => users, :model => "foo", :record => "baa"

Then template propaties.
  Query Text: /foo/baa

(2) Set a template file.

jasper_pdf :resource => users, :template => "users/list"

Then use this template file.
# app/views/users/list.jaster

(3) Use ActiveRecord resource.

user = User.all
jasper_pdf :resource => users

Copyright © 2012 Kazuhisa Yamamoto. See LICENSE.txt for further details.