Sha256: 5504bb3c2edec7624b0df76e116908772f9d3bae6d045242bfd0750f860ec52c

Contents?: true

Size: 1.53 KB

Versions: 2

Compression:

Stored size: 1.53 KB

Contents

# Welcome to Casper
# The friendly cousin of Jasper Reports

# Casper allows you to generate a pdf from a jrxml file, xml data, and a xpath selector

# The compile statement return a string of bytes that can be streammed to file or to
# a browser.

# Example:
#
#  c = Casper.new
#  pdf_data = c.compile open('text.jrxml'), open('data.xml'), '//node'
#  open('mypdf.pdf', 'wb').write pdf_data

# Requirements
# This Gem requires jruby > 1.6.0
require 'java'
# Load Jar and Java Classes
$CLASSPATH << File.join(File.dirname(__FILE__), '..', 'include', 'lib', 'commons-digester-1.7.jar')
$CLASSPATH << File.join(File.dirname(__FILE__), '..', 'include', 'lib', 'commons-logging-1.1.1.jar')
$CLASSPATH << File.join(File.dirname(__FILE__), '..', 'include', 'lib', 'commons-collections-2.1.1.jar')
$CLASSPATH << File.join(File.dirname(__FILE__), '..', 'include', 'lib', 'commons-beanutils-1.8.0.jar')
$CLASSPATH << File.join(File.dirname(__FILE__), '..', 'include', 'lib', 'groovy-all-1.7.5.jar')
$CLASSPATH << File.join(File.dirname(__FILE__), '..', 'include', 'lib', 'xalan-2.7.1.jar')
$CLASSPATH << File.join(File.dirname(__FILE__), '..', 'include', 'lib', 'itext-2.1.7.jar')
$CLASSPATH << File.join(File.dirname(__FILE__), '..', 'include', 'dist', 'jasperreports-4.0.1.jar')
$CLASSPATH << File.join(File.dirname(__FILE__), '..', 'include')

# Provide a simple class interface to running a jasper report
class CasperReports
  #VERSION = '0.0.1'

  def compile(jrxml, data, xpath)
    String.from_java_bytes(Java::XmlDataReportProducer.compile(jrxml, data, xpath))
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
casperreports-0.0.3 lib/casper_reports.rb
casperreports-0.0.1 lib/casper_reports.rb